Load balancing and UseSlaveServer=true

Author Message

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

Tony Wood

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.

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

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

Tony Wood

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.

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

Gabriel Ambuehl

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

Visit http://triligon.org

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:31:21
Script start
Timing: Jan 18 2025 19:31:21
Module start 'layout'
Timing: Jan 18 2025 19:31:21
Module start 'content'
Timing: Jan 18 2025 19:31:22
Module end 'content'
Timing: Jan 18 2025 19:31:22
Script end

Main resources:

Total runtime0.6514 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 588.0391152.6406
Module start 'layout' 0.00630.0041 740.679739.4922
Module start 'content' 0.01030.6399 780.1719616.1328
Module end 'content' 0.65020.0012 1,396.304716.1406
Script end 0.6514  1,412.4453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.6126160.0002
Check MTime0.00140.2080160.0001
Mysql Total
Database connection0.00080.127410.0008
Mysqli_queries0.592190.8844680.0087
Looping result0.00060.0942660.0000
Template Total0.619895.120.3099
Template load0.00200.304620.0010
Template processing0.617894.840620.3089
Template load and register function0.00010.017310.0001
states
state_id_array0.00130.199110.0013
state_identifier_array0.00140.209220.0007
Override
Cache load0.00170.2633380.0000
Sytem overhead
Fetch class attribute can translate value0.00070.112430.0002
Fetch class attribute name0.00110.163280.0001
XML
Image XML parsing0.00110.171030.0004
class_abstraction
Instantiating content class attribute0.00000.0030100.0000
General
dbfile0.00200.3050230.0001
String conversion0.00000.001340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs