in reply to Re^3: Optimize DBI connect to avoid max_user_connections
in thread Optimize DBI connect to avoid max_user_connections

Ok, will give it a try if the problem will persist. Any ideas if the the problem may be in the code ? Until now I did not have an "or db-disconnect & exit" command after the querys if they do not succeed. Could this be the problem so the script goes persistent and waits for the query to finish ? The MyAdmin log showed nothing suspicious just regular querys. Its driving me mad, so sorry for bothering everyone :-(
  • Comment on Re^4: Optimize DBI connect to avoid max_user_connections

Replies are listed 'Best First'.
Re^5: Optimize DBI connect to avoid max_user_connections
by fishmonger (Chaplain) on May 29, 2014 at 21:53 UTC

    If you don't do an explicit disconnect, the module should do it for you when the handle goes out of scope or as part of the garbage collection process when the script ends. However, that doesn't always happen. I had a script connecting to a pervasive db and didn't have an explicit disconnect. Latter I learned that connections weren't being disconnected which caused the db to lockup when it reached the max connections.

    The next time this problem comes up connect to the mysql cli or you can use phpmyadmin to run the following command.
    show full processlist;

    That will show you the connections and processes being executed.