This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Install & configuration » Persistent connections
expandshrink

Persistent connections

Persistent connections

Thursday 07 May 2009 9:46:40 am - 15 replies

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

Tuesday 12 May 2009 1:56:03 pm

Nobody?

Tuesday 12 May 2009 3:16:47 pm

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.c...are-php-persistent-connections-evil/
http://blog.ulf-wendel.de/?p=211

Tuesday 12 May 2009 3:20:58 pm

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

Modified on Tuesday 12 May 2009 3:22:32 pm by Ɓukasz Serwatka

Tuesday 12 May 2009 5:53:13 pm

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.

Friday 03 July 2009 11:23:11 am

Ok, one more time happy.gif Emoticon

persistent connections with mysql. Any experience?

Thursday 09 July 2009 2:20:54 pm

Finally got an information on this.
There is no persistent connection support in eZ sad.gif Emoticon

Thursday 09 July 2009 2:59:47 pm

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

Thursday 09 July 2009 4:00:02 pm

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

Thursday 09 July 2009 7:47:57 pm

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

Friday 10 July 2009 9:29:41 am

Gaetano,

Do you use somewhere pconns on live sites?

Friday 10 July 2009 2:06:47 pm

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

Friday 10 July 2009 3:50:09 pm

What about mysql?

Friday 04 January 2013 5:41:38 pm

Hello,

I'm having deadlock and lock wait timeout errors on a DFS clustered EZ 4.5 installation, using MySQLi. Persistent connections are enabled for MySQLi.

Could it be the cause of my "deadlocks" and "lock wait timeout" errors ?

Monday 07 January 2013 12:52:37 pm

@OpenWide short answer: no. Persistent database connections are a completely orthogonal topic to deadlocks / lock-wait timeouts.

Wednesday 09 January 2013 9:35:40 am

Thank you Gaetano,
moreover, persistent connections are disabled in site.ini by default.

Now, I'm still trying to figure out why we have these errors. Our platform is designed for high load with 4 front-servers and 2 BD servers in master-slave setup. We are on DFS cluster setup.

[ Dec 31 2012 14:35:04 ] [192.168.51.13] eZDFSFileHandlerMySQLiBackend::_startCacheGeneration:
Unexpected error #1205 when trying to start cache generation on var/mysite/cache/content/my_siteaccess/3/5/3545-9ea6e6d32b809e0c0f70a540775016f4.cache (Lock wait tieeded; try restarting transaction)

[ Dec 31 2012 14:36:42 ] [192.168.51.11] :
Failed to open DFS://var/mysite/cache/content/my_siteaccess/3/3/1/33103-8968c34b68e838edb578442b503ae300.cache.generating for writing
[ Dec 31 2012 14:36:42 ] [192.168.51.11] _endCacheGeneration( var/mysite/cache/content/my_siteaccess/3/3/1/33103-8968c34b68e838edb578442b503ae300.cache ):
An error occured renaming DFS://var/mysite/cache/content/my_siteaccess/3/3/1/33103-8968c34b68e838edb578442b503ae300.cache.generating to DFS://var/mysite/cache/content/my_siteaccess/3/3/1/33103-8968c34b68e838edb578442b503ae300.cache

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from