Announcement

Collapse
No announcement yet.

Master / Slave Database Improvements?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Master / Slave Database Improvements?

    Can someone tell me what the improvements are for vB 3.6.0 in relation to the listed "Improved master / slave database support"?

    My main question is this... Is there logic in the code so that when a person makes a new post / thread, do they stay sticky to the master server so their reply will show up if the page has to be refreshed or does it just blindly go to the slave server for all read requests?

    The issue I have is that searching can take a couple minutes (4.3 million posts) and if the slave server has a read lock on the post table obviously new posts won't be updated on it right away. So when a person creates a new thread if the slave db hasn't updated, wouldn't that cause an error?

  • #2
    Not going to get an answer to this am I?

    Comment


    • #3
      I don't know but I'll see if I can get someone to answer.
      Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
      Change CKEditor Colors to Match Style (for 4.1.4 and above)

      Steve Machol Photography


      Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


      Comment


      • #4
        Thanks Steve, I would really appreciate it.

        Comment


        • #5
          Only certain queries that wont cause inconsistentices are sent to the slave. This means that most of the post and thread stuff are on the master apart from those where a long wait or slightly incorrect data doesn't matter.

          At the moment reads for posts on showthread always go to the master, I've yet to devise a nice way to look at the lag time between the master and slave and use the appropriate table.
          Scott MacVicar

          My Blog | Twitter

          Comment


          • #6
            Does searching use the slave db? If not is there an easy way to have it do so?

            Comment


            • #7
              Originally posted by eoc_Jason View Post
              Does searching use the slave db? If not is there an easy way to have it do so?

              up

              WW

              Comment


              • #8
                Originally posted by eoc_Jason View Post
                Does searching use the slave db? If not is there an easy way to have it do so?
                same question here - we want to send all earches to the slave, what is the easiest way to do this?
                thanks
                Internet Bike Community
                Mountainbike News Mountainbike Forum

                www.mtb-news.de

                Comment


                • #9
                  Under the slave config wrap it in

                  if (THIS_SCRIPT == search.php)
                  {



                  }
                  Last edited by Steve Machol; Mon 4th Sep '06, 11:44pm. Reason: added the P to script. :)

                  Comment


                  • #10
                    Under the slave config wrap it in

                    if (THIS_SCRIPT == search.php)
                    {



                    }
                    it must be search, not search.php.
                    Internet Bike Community
                    Mountainbike News Mountainbike Forum

                    www.mtb-news.de

                    Comment


                    • #11
                      My bad, I was writing it quickly

                      Comment


                      • #12
                        Originally posted by Zachery View Post
                        My bad, I was writing it quickly
                        ok, we tried it - the suggested approach has one disadvantage / causes one problem:
                        the searchid is inserted into the slave, so the databases are out of sync. When you execute only one search on the master-db you will get a duplicate key error and the slave stops replicating itself.

                        I will try to hack search.php, so it runs against the master and only the fulltext-search itself is executed on the slave.

                        Thomas
                        Internet Bike Community
                        Mountainbike News Mountainbike Forum

                        www.mtb-news.de

                        Comment


                        • #13
                          Searches are sent against the slave database in 3.6, you dont need to make any changes in config.php etc.

                          You do however need to change dbtype in config.php to either mysql_slave or mysqli_slave
                          Scott MacVicar

                          My Blog | Twitter

                          Comment


                          • #14
                            thanks for the clarification - will upgrade to 3.6 then
                            Thomas
                            Internet Bike Community
                            Mountainbike News Mountainbike Forum

                            www.mtb-news.de

                            Comment

                            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                            Working...
                            X