MySQL Forums
Forum List  »  Performance

Re: MySQL Server crashes - spawning too many threads.
Posted by: Jay Pipes
Date: July 30, 2005 11:36AM

There's no reason to use mysql_pconnect if you are using PHP through Apache. There is no benefit to using a persistent connection unless you are using the CLI-SAPI for PHP, because Apache web requests cannot share the database connection resource from one request to the next, partly because of the stateless nature of HTTP protocol, and partly because Apache handles the spawning of child processes differently. I believe there is only a possibility of sharing resources among child processes spawned by the same thread in Apache, and in my experience, there is no benefit, and I've seen performance drawbacks from using mysql_pconnect(). It won't happen too often, but what I've noticed is that if an Apache process "dies" or becomes a zombie (seen as DEFUNCT in ps or top), then any persistent connection that process was using immediately becomes locked and tied to the useless zombie process. This doesn't happen with non-persistent connections, as far as I can tell.

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.