Hi,
I have a question and would be very thankful on any helping comments whatsoever.
I am running a PHP web application on a two webserver cluster. I also have two master-slave-replicated MySQL 5x databases.
What I want to do now is to send read-only-queries to the slave and all others queries to the master, or, better yet, to send write-queries to the master only and read-only-queries to 70% to the slave and 30% to the master (as I expect around 90% read-only-queries after all).
I already tried the not-yet-documented “mysqli_slave_query” and “mysqli_master_query” functions, but it did not work. I also tried “mysqli_enable_rpl_parse”, which at least did not put out any error messages but all queries were sent to the master.
Last thing I tried was to open two database connections and do the parsing myself, which led me into having only half the performance. Not good.
I also googled myself through thousends of sites but could not find any helpful advice, maybe I do here?
Thanks a lot!
Stefan.