getting too many connections errors (Mysql)

Category: Website

newjerseystage
Asked:
2013-02-27 12:44 pm EST

Hits: 1,066
I have two heavily Mysql-driven websites (NewJerseyStage.com and ThePenguinRocks.com) and I'm running into this error all morning:

Warning: mysql_pconnect() [function.mysql-pconnect]: Too many connections in /home/newjer13/public_html/gw.inc.php on line 7
Unable to select database



What can I do to prevent this? I've just started promoting my websites, so traffic is going up. Is this a coding issue or could I possibly be hitting the maximum number of users at one time?

The sites have been working fine for years. These errors are just popping up now.

You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

0

johnpaulb-imhs1
Staff
8,322 Points
2013-02-27 5:17 pm EST
Hello newjerseystage,

Thank you for your question. As per your warning, you are using pconnect:
mysql_pconnect

It is not recommended to use persistent mysql connections, because it allows one visitor to make multiple connections.

With a regular connect, it will process the connection, then close the connection once it finishes.

Here is a link to an article here in our support center that explains persistent connections in better detail.

It is likely that bots are crawling your websites, which is normal, and each time they hit a page, it makes a connection. With pconnect it does not close the previous connection, so when a bot hits every page without disconnecting it can use up your connections.

If you have any further questions, feel free to post them below, or contact live Tech Support.

They are available 24/7 via:
Email: support@inmotionhosting.com
Phone: 888-321-HOST (4678)
757-416-6575 (Intl.)
&
Chat (there is a link on the top right).

Thank you,

-John-Paul

You must login before you can post a comment about this answer.

Like this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!