After some recent changes a site has started showing the max_user_connections
error which is probably a sign that too many concurrent connection attempts are being to the MySQL database.
I've noticed that the original programmers implemented a "DB" class for managing database connections and it seems that a close is only called in the footer of each page. How could I go about improving this? Should I create a db object for each request I want to make and then close immediately after results have been retrieved?