Hi there,
I have code spanning on multiple files with lots of queries all over.
apparently I may have missed out on closing db connection and it didn't take long to find that I have sleeping connections that hog the database.
I just learned about this problem when my hosting provider
just cut me out of the server.
When I issued this command, I saw my 'sleeping' connections: (requires password).
mysqladmin -u MYDOMAINNAMEHERE -p processlist
At the same time, he also let me know about the persistent
connection option that will not trigger new connections if it finds
a 'same db, user and password' call.
The question is:
I need a sample code for using it.
My code is basically doing sql calls and fetch calls.
Instead of doing a disconnect and reconnect, I can re-use the
persistent option (If I'd know how it looks).
If you have some info about it, please let me know.
Thanks,
-Alon.