Also make sure you close the mysql connections if you are using way too many of them. I believe that the connections get closed when your script stops executing, but it is never a good idea to have a zillion open connections lurking around your app.
Try using a single instance of every db...