I'm working on tweaking my server because I'm having a problem with running out of memory. I've read a bunch of the docs about optimizing the mysql database here, but there seems to be contradicting information regarding persistent connections.

I have them turned off right now and am considering turning them on, but I'd like some feedback. Does it actually help with memory?

Could use some insight on this issue.

Comments

Chaos_Zeus’s picture

I am having problems with my tmp table not cleaning up and running out of connections to the db. I just turned on the persistant connections with

 ini_set('mysql.allow_persistent', TRUE); </code

and also set 
<code>ini_set('mysql.max_links', 500);

To see if that changes my behavior any. my problem is the temp table runs out, corrupts a bunch of myisam files containing the database for some reason, and suddenly I start generating more than 5000 queries per hour or something.

kus’s picture

This recommends disable pconnect
http://drupal.org/node/42626

This one recommends to enable pconnect
http://drupal.org/node/51263

confusing...

darthcheeta’s picture

i'm having problems with multiple open mysql connections bogging down my server under heavy traffic. i just added these lines to my settings.php file as well.

how did it work out for you in the long run?

Chaos_Zeus’s picture

I haven't seen any difference either way. I have several sites using the same database, some set to persistent, some not. I have no idea what it should be set at. Persistent seems to make more sense to me than not, so that is what I am going with. Always looking for opinions.

j.m.’s picture

I wish to revive this subject because I'm currently working on it and haven't found a way to make it really faster with "pconnect" in Drupal 5.

Please see my comment on Persistent database connections page for what I have done so far.

Any more insight would be great.

Thanks.