19 pointsStarting to get into this DEV thingI'm new here
Marty Martin
Member
—
27th October 2009
The mysql process on my mu server keeps overloading and bogging the site down. My host recommended turning off persistent connections, but before I do that, I wanted to see if anyone knew of any good reason to leave it on. The only thing running on the server right now web-wise is Mu.
The mysql process on my mu server keeps overloading and bogging the site down. My host recommended turning off persistent connections, but before I do that, I wanted to see if anyone knew of any good reason to leave it on. The only thing running on the server right now web-wise is Mu.
As far as I'm aware, WordPress doesn't use persistent connections anyway. So there shouldn't be any harm turning them off (though I doubt they were causing the problem in the first place)
If it's just a matter of too much traffic, you can either upgrade your server, move the DB to a second server, or if you don't have caching enabled try something like WP Supercache (that can help a lot).
As far as I am aware in order for php (and thus WordPress) to use a persistent connection it has to use the mysql_pconnect function to open the connection.
Responses (4)
Developer — 27th October 2009 #
As far as I'm aware, WordPress doesn't use persistent connections anyway. So there shouldn't be any harm turning them off (though I doubt they were causing the problem in the first place)
http://www.mydigitallife.info/2007/09/14/using-php-mysql-persistent-connections-to-run-wordpress-blog/
Lead Developer — 28th October 2009 #
If it's just a matter of too much traffic, you can either upgrade your server, move the DB to a second server, or if you don't have caching enabled try something like WP Supercache (that can help a lot).
First you should try optimizing mysql though. Try the slow query log for starters:
http://www.google.com/search?q=slow+query+log&ie=utf-8&oe=utf-8&aq=t
Member — 28th October 2009 #
@Barry:
can you dig out more information about that? just curios, as I also have persistent connections enabled and I am exclusively hosting wp/wpmu sites...
so if its not needed I could turn that off too...
btw. are we talking about the persistent connections settigns in apache or is there a similar setting for mysql too?
Developer — 28th October 2009 #
As far as I am aware in order for php (and thus WordPress) to use a persistent connection it has to use the mysql_pconnect function to open the connection.
http://php.net/manual/en/function.mysql-pconnect.php
The standard WordPress database library doesn't, it uses the standard mysql_connect:
http://www.php.net/manual/en/function.mysql-connect.php
I'll do some more hunting and testing to confirm.
Become a member