Forums / Install & configuration / Load balancing and UseSlaveServer=true

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

eZ debug

Timing: Jan 30 2025 21:41:04
Script start
Timing: Jan 30 2025 21:41:04
Module start 'content'
Timing: Jan 30 2025 21:41:04
Module end 'content'
Timing: Jan 30 2025 21:41:04
Script end

Main resources:

Total runtime0.2488 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0085 588.0703370.2813
Module start 'content' 0.00850.0152 958.35161,009.5781
Module end 'content' 0.02370.2251 1,967.92973,897.9922
Script end 0.2487  5,865.9219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00471.8985200.0002
Check MTime0.00140.5548200.0001
Mysql Total
Database connection0.00110.426810.0011
Mysqli_queries0.149259.95981410.0011
Looping result0.00150.61281390.0000
Template Total0.224690.310.2246
Template load0.00090.360410.0009
Template processing0.223789.889010.2237
Override
Cache load0.00060.257910.0006
Sytem overhead
Fetch class attribute can translate value0.00190.748310.0019
XML
Image XML parsing0.00030.109710.0003
General
dbfile0.00652.6176200.0003
String conversion0.00000.003230.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs