Hi,
I used php-dbi functions in my website and they worked great until yesterday. Yesterday my hosting provider disconnected me
from my MySQL after he informed me that he found multiple sleeping connection to the database.
I ran
mysqladmin -u MYDOMAINNAMEHERE -p processlist
to see if this is the case, and indeed I found that I was creating such sleeping connections.
I decided to isolate the cause in the code and find where is it that I create multiple sleeping connections.
This is where I actually asking for your help:
I'm not savvy with db admin, but my understanding is that:
Using mysql_pconnect I'm establishing a persistant connection and whenever I'm calling dbi_query in my page
I'm 'skipping' the connection procedure again to the db, as it is using the persistant link.
That is good and great. The problem is, that I think that is not happening with my calls. I believe I'm creating
persistant connections but never re-use them or at least the code doesn't recognize them and opens another
connection for each query.
The question now is, how do trace the query that initiated the persistent connection, and why is it that it
is not recognized as an open connection?
Last, when and how does a persistant connection dies? dbi_close doesn't work with it. What does?
Thanks for your help.
-Alon.