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

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