Welcome to WebmasterWorld Guest from

Forum Moderators: phranque

Message Too Old, No Replies

too many connections to the database (MySQL)

i need some body to see the page code to tell me whats wrong

9:59 pm on May 17, 2005 (gmt 0)

New User

10+ Year Member

joined:Feb 17, 2005
votes: 0

hi everybody ..

i have a problem in the loading of my website .. it takes about 2 minutes to load while it takes usually 20 seconds..

the hosting company said that there are many mysql connections causes this slow .. and they added that i have to change some codes in the main page of the site the make sure that every connection is openned is closed after that,,

i have no knowlege in databases .. and i cant even understand the meaning of connections!

so can anybody see the code of the page and tell me whats wrong?

i really need help.. i have more than 10,000 visits per day and the users started to get angry..

i hope i can post the site here, but really i dont mean any kind of advertisment ..

the page that have the too many connections is <snip>

thnx again everybody for reading this topic to the end :)

[edited by: trillianjedi at 9:39 am (utc) on May 18, 2005]
[edit reason] No URL drops please.... [/edit]

10:32 pm on May 17, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Sept 1, 2001
votes: 0

I tried to load the site, but it did take a great deal of time.

Understading connections is very important if you are going to use a database.

Everytime you call a query, your website has to connect. When you are finished with the query, you need to disconnect, otherwise, those connections stay open, waiting for instructions.

A server can only handle so many connections before it just shuts down. And your host might not like that.

Find a good tutorial on mySQL and PHP and look up "closing connections"


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members