|
|
Mysql Error Never Seen On My Site Before (too Many Connections). | ||
Discussion by Chesso with 13 Replies.
Last Update: July 31, 2006, 8:28 pm | |||
Warning: mysql_connect(): Too many connections in /xxxx/xxxxx/xxxxxx_xxxxx/xxx/xx_xxxx.php on line 7
Error! Could not connect: Too many connections.
I have never recieved this error before, does this mean someone is mucking with my site somehow???
The particular php file it mentions is the one that defines variables like db username etc and connection to the site's database that I include wherever it is needed in various file for the site.
EDIT:
I managed to get in and went to another page and again recieved another error message:
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /xxxx/xxxxx/xxxxxx_xxxx/xxx/xx_xxxxx.php on line 7
Error! Could not connect: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Sat Jul 29, 2006 Reply New Discussion
Sat Jul 29, 2006 Reply New Discussion
Please pardon me if I'm being very explosive but when it last happened and I posted a problematic thread/post on the hosted members' support page, I don't believe I got any help on it.
I saw other people's posts about the same thing / incident but I don't believe they got any help either.
What's going on?
Sat Jul 29, 2006 Reply New Discussion
*phew, whipes forhead*
Sat Jul 29, 2006 Reply New Discussion
on my personal machines, i have set the max connection to a very large numbers and that is not a big problem though since i have a bigger memory and cpu power.. besides my webserver, nothing is running on it..
--
in environments like asta, we cannot change the max connection of the database server since it will affect all users and may bog down the whole system in total..
--
the was one error more if the problem is database incapability to handle new connection, it will yank a port or socket connection error.. i believe that is apache or PHP engine that is yanking that error..
Sat Jul 29, 2006 Reply New Discussion
Sat Jul 29, 2006 Reply New Discussion
P.S. Does anyone have any clue how you can have increased AdSense ad sizes? I use 728x90 but I need it atleast with 738 width...
Sat Jul 29, 2006 Reply New Discussion
Sat Jul 29, 2006 Reply New Discussion
Oh well, guess I'll have to deal with it looking weird.
Sat Jul 29, 2006 Reply New Discussion
That message is just a sort of "protection" for MySQL. if it allowed many connections, the MySQL server could crash due to a high amount of connections. It is sorta the server's "safety backup" kicking in. I guess a lot of people are using MySQL then.
This should be nothing to worry about.
[N]F
Sat Jul 29, 2006 Reply New Discussion
QUOTE (pyost)
Nope, you can use only those that are predefined in the AdSense control panel.
Link: view Post: 83741
As a matter of fact I saw Google ads which looked a bit customized, I don't know how they did it, but I think they just added javascript, but maybe this is special ads of somekind, they really pointed to google adsense links, can't remember the site, so maybe it is possible, you always can email google adsense team, but I don't know what they could answer, it is better to ask if it is possible and not if I can, I think
Sat Jul 29, 2006 Reply New Discussion
QUOTE (cyborgxxi)
I had this problem like a thousand times on my website before. I mean, I thought it would be some sort of an uptime/downtime problem but I have no idea what the heck is going on!!Please pardon me if I'm being very explosive but when it last happened and I posted a problematic thread/post on the hosted members' support page, I don't believe I got any help on it.
I saw other people's posts about the same thing / incident but I don't believe they got any help either.
What's going on?
Link: view Post: 83712
The reason you received no help on the matter is because by the time someone noticed the post, the problem was gone. SO in order to reply to your particular post, "Please wait and do not refresh your website over and over and see how things are in about an hour if the problem hasn't already be resolved."
We all share the same MySQL server. The too many connections refers to everyones connections usually. While there is a cap on the number of connections each website may have at once, the entire server also has a cap which is not as large as all of the individual accounts put together so if 10% or more of the websites are at or near their maximum, then the server could be overwhelmed. I'm not sure what the exact figures are for these settings but this is usually what happens. This usually clears up in a few minutes unless we get a few impatient people trying to get the pages to load. Now not only did you have too many connections on the server to begin with, everybody is trying to refresh the error page to get the webpage to load correctly. Few people realize that by repeatedly trying to get the page to load they are actually making the problem worse. Most database connections last less than a secondso in order to have too many connections, there has to be a lot of connection requests all at the same second for the most part.
Probably the biggest cause of this error to begin with is poor script optimization. Basicaly Joe Blow writes a script that accesses the database in a sloopy way. As a result, his sloopy code on his rather poorly designed website can have the same impact on the server as Bill's really busy and well designed website. So Joe's site kills the server then Bill's users keep the server over taxed with their page refreshes and reloads.
OpaQue tries to identify websites on the server that have this kind of negative impact on the rest of the accounts and either work with the account holder to correct the problem or if need be remove the problem file.
So my suggestion to you is to create a backup page for your website that you can use to relieve the server burden. Some kind of "Technical Difficulties" message that you can set all of your webpages to redirect to via your .htaccess file. Then when this proble comes up, just switch over to your message page and that will prevent your users from continuing the connection flood on the database server.
Better yet, rewrite your scripts to respond better to the Too Many Connections Error. If this happens instead of telling the user right away, make the script sleep for a few seconds so they don't refresh right away. A five second pause for everyone on your site could be just what the server needs to get caught up. Using a random number between 5 and 10 seconds would also keep everyone from your website from having the opportunity to refresh at the same time.
One additional suggestion, let your user know what the problem and the solution is. If you tell your user that the problem is caused by too many connections at the same time and inform them that refreshing the page will only make the problem worse, they will be less likely to add to the problem. Kindly ask them to wait a minute before they try to refresh and most will at leat give it 10 seconds.
For best results, you should use all of these techniques together. If everyone used just one of these suggestions, then the server would never be down. This is particularly true for a server pause when this error occurs since the server just needs a second or two without a connection request.
Hope this helps.
vujsa
Mon Jul 31, 2006 Reply New Discussion
Mon Jul 31, 2006 Reply New Discussion
i dont know what is going on but judging on the number of shared hostings here..
3 malfuntioning scripts specially if they are on cron can crashed the server almost instantly...
the negative impacts of shared hosting..
Mon Jul 31, 2006 Reply New Discussion
Space Usage.. Question about space usage after deleting some stuffs using cpanel (3)
|
(3) Not Being Deleted yes, i need to be
|
Index




