Forums / Install & configuration / Persistent connections

Persistent connections

Author Message

Ivo Lukac

Thursday 07 May 2009 12:46:40 am

Does anybody have experience with persistent connections with mysql database?
What about using it in cluster setup (files in database)?

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Ivo Lukac

Tuesday 12 May 2009 4:56:03 am

Nobody?

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

André R.

Tuesday 12 May 2009 6:16:47 am

Not strictly on topic, but fyi persistent connections are not supported by mysqli.
It is added to PHP 5.3, but there is no direct support for it in eZ Publish yet ( will probably add support in 4.2).

Some nice reading on php, mysql and persistent connections:

http://www.mysqlperformanceblog.com/2006/11/12/are-php-persistent-connections-evil/
http://blog.ulf-wendel.de/?p=211

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Łukasz Serwatka

Tuesday 12 May 2009 6:20:58 am

The setting in eZ Publish decide how the application connect to the database. Basically it is mysql_connect or mysql_pconnect for persistent connections (while using MySQL driver).

In PHP realm you can learn more about it from:

http://pl2.php.net/manual/en/features.persistent-connections.php
http://pl2.php.net/mysql_pconnect

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Ivo Lukac

Tuesday 12 May 2009 8:53:13 am

Thanks guys but I know what p-connections are, just want to know does anybody use it on production server, are they stable enough in eZ.

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Ivo Lukac

Friday 03 July 2009 2:23:11 am

Ok, one more time :)

persistent connections with mysql. Any experience?

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Ivo Lukac

Thursday 09 July 2009 5:20:54 am

Finally got an information on this.
There is no persistent connection support in eZ :(

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Ivo Lukac

Thursday 09 July 2009 5:59:47 am

False alarm, persistent connection are implemented for mysql and postgres.
Not for mysqli.

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Thursday 09 July 2009 7:00:02 am

i wonder about other dbs too like Oracle; do they offer this?

Gaetano Giunta

Thursday 09 July 2009 10:47:57 am

Sure enough.
On oracle, the connection handshake is much heavier than it is in mysql, so persistent connections are usually faster/recommended.
They also have a lot of benefit in internal memory structures reusage and sharing.
Otoh you will have to be careful tuning your resource allocation, as it is hard to put a clear limit on max persistent connections open from php to the db (apache max processes + cronjobs + cli scripts run on the spot +maybe more in cluster mode?), and all the connections will usually stay open eating your resources even if there are no users connected to the db, and you will have to be careful of connection state if there is a db restart while apache is running (all of this has been alleviated in recent php versions with some extra params in php.ini dedicated to tuning those aspects).

Principal Consultant International Business
Member of the Community Project Board

Ivo Lukac

Friday 10 July 2009 12:29:41 am

Gaetano,

Do you use somewhere pconns on live sites?

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Gaetano Giunta

Friday 10 July 2009 5:06:47 am

At least two clients do - of those running oracle. Maybe more: those are the ones I worked for personally...

Principal Consultant International Business
Member of the Community Project Board

Ivo Lukac

Friday 10 July 2009 6:50:09 am

What about mysql?

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

eZ debug

Timing: Jan 18 2025 10:41:56
Script start
Timing: Jan 18 2025 10:41:56
Module start 'content'
Timing: Jan 18 2025 10:41:56
Module end 'content'
Timing: Jan 18 2025 10:41:57
Script end

Main resources:

Total runtime0.1915 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 589.1563180.8359
Module start 'content' 0.00620.0060 769.9922113.8828
Module end 'content' 0.01210.1792 883.8750541.9063
Script end 0.1914  1,425.7813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00371.9117200.0002
Check MTime0.00150.7811200.0001
Mysql Total
Database connection0.00090.446510.0009
Mysqli_queries0.141573.90701410.0010
Looping result0.00140.75511390.0000
Template Total0.178793.310.1787
Template load0.00090.445510.0009
Template processing0.177892.867610.1778
Override
Cache load0.00060.304910.0006
Sytem overhead
Fetch class attribute can translate value0.00070.377710.0007
XML
Image XML parsing0.00020.128510.0002
General
dbfile0.00190.9721200.0001
String conversion0.00000.002730.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.0002 secs