eZ Community » Forums » Install & configuration » Load balancing and UseSlaveServer=true

Load balancing and UseSlaveServer=true

Load balancing and UseSlaveServer=true

Monday 28 April 2003 1:51:08 pm - 5 replies


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.



Monday 28 April 2003 4:22:30 pm

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;
$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.


Monday 28 April 2003 4:53:31 pm

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.


Monday 28 April 2003 5:15:12 pm

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?

Monday 28 April 2003 5:21:32 pm

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 7:19:01 pm

That's what my benchmarks said as well. MySQL took maybe 3% CPU, PHP all the rest...


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from