[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: MySQL is eating up my RAM



On February 26, 2003 08:01 pm, louie miranda wrote:
> > Check the PHP scripts that are accessing your server.  If they
> > are using the "mysql_pconnect" function (persistant connections)
> > to connect to the database, tell them to use "mysql_connect"
> > instead. Persistant connections can cause problems like you
> > describe because they will sometimes not be closed and clog up
> > the mysql server.
>
> Do mysql_pconnect really never close its connection? or sometimes
> it closes, but in general its sometimes do not close its connection
> goint to mysql?

I'm not entirely sure if it never closes the connection.  It probably 
should time out after a while but lots of people have problems with 
it.  From the php manual:
First, when connecting, the function would first try to find a 
(persistent) link that's already open with the same host, username 
and password. If one is found, an identifier for it will be returned 
instead of opening a new connection. 

Go here: http://www.php.net/manual/en/function.mysql-pconnect.php
and read the user comments.  There is some useful info on how to deal 
with persistant connections if you have no control over what scripts 
are run on your server (setting timeouts on MySQL, etc).

Leo



Reply to: