Well, this problem is caused by a setting in MySQL limiting the number of connections.problem can be solved by lifting the limit....If your site is not big..You should investigate why your database user has so many connection at the same time..the number you posted here is really big one...I doubt there is a code issue in your script.
You can solve this by open late/close early theory.
I bet you are on shared hosting..anyways..Your host provider should help you on this issue.