Forums / Install & configuration / Load balancing and UseSlaveServer=true
Tony Wood
Monday 28 April 2003 4:51:08 am
Hi,
I am testing the slave server setup with two machines a master and slave. The servers are running mySQL 4 with replication Master->Slave working correctly. Can you please let me know how eZ decides to use the slave server?
Does it default to the slave or master if DNS match? Does it test speed of connection and choose fastest?Does it open two connections?
Some guidelines on usage please.
tia
tony
Tony Wood : twitter.com/tonywood Vision with Technology Experts in eZ Publish consulting & development Power to the Editor! Free eZ Training : http://www.VisionWT.com/training eZ Future Podcast : http://www.VisionWT.com/eZ-Future
Bård Farstad
Monday 28 April 2003 7:22:30 am
You need to configure the slave server in site.ini ( an override for your system ). The slave servers are used on read queries only. Write queries are sent to the main database server.
If more than one slave server is used in the setup eZ publish will just choose a random slave. The algorithm is as follows: if ( $numberServers > 1 ) { $index = rand( 1, $numberServers ) - 1; } else $index = 0;
Pretty simple, for now.
Yes, eZ publish will open one read and one write connection on the slave server. On the master the same connection will be used.
--bård
Documentation: http://ez.no/doc
Monday 28 April 2003 7:53:31 am
Thanks for explanation i understand how it can be used correctly now and have tested it here and it works. If it all pans out well it will go into the production environment.
Could the db server used by eZ could be added to the debug output, so you could see the read server and the write server used.
I look forward to seeing how the loadbalancing develops.
Gabriel Ambuehl
Monday 28 April 2003 8:15:12 am
I'd be quite interested to hear something about the frontend/backend you're using there. At what point do I need to think about boosting DB performance as opposed to adding more power for the frontend webservers?
Visit http://triligon.org
Monday 28 April 2003 8:21:32 am
We have a failover solution in place so i have access to two databases the slave and the master. I am looking to see if i can speed up the DB access by using the slave environments. We are looking at getting speed from everywhere, the main area to hit is PHP but every second counts so we are looking at the backend too.
Monday 28 April 2003 10:19:01 am
That's what my benchmarks said as well. MySQL took maybe 3% CPU, PHP all the rest...