|
14-02-2007, 21:58 | #1 |
Moonshine
Join Date: Jul 2006
Location: Nr Liverpewl
Posts: 4,371
|
Any MySQL experts in the house?
For the past few weeks I've been having random outages on my photoblog. Visitors get the "Database connection error" message instead of my site. Annoyingly due to the way Wordpress works I can't even access the admin page when this happens. I've been speaking with my host and they say its because some script isn't closing the connection. They say they allow 10 MySQL connections at the same time. My site isn't *that* popular, surely. Larger forums work well enough. This forum does. My site gets 2,000 unique visitors a day. Thats a lot for me, but surely not a lot for MySQL or a large Wordpress site. I'm currently debating whether to spend £200 and jump ship, but £200 at the moment is a lot just to fix a number. Is 10 a small limit? I've been told their a reseller posing as a proper company.
|
14-02-2007, 22:05 | #2 |
Screaming Orgasm
Join Date: Jul 2006
Location: Newbury
Posts: 15,194
|
Have a look in the configuration for anything about persistant connections (pconnect). Turn them off.
On shared hosting, persistant MySQL connections are the evil spawn of satan. |
14-02-2007, 22:07 | #3 |
Moonshine
Join Date: Jul 2006
Location: Nr Liverpewl
Posts: 4,371
|
mysql.allow_persistent is turned off. So far my host has told me a few things including deleting and recreating the user. I've just got this feeling that they don't know jack.
|
14-02-2007, 22:09 | #4 |
Screaming Orgasm
Join Date: Jul 2006
Location: Newbury
Posts: 15,194
|
10 connections isn't *that* much for a busy site, but it is a lot for an 'average' non-professional site, so it's all down to how busy your site really is.
|
14-02-2007, 22:21 | #5 |
Preparing more tumbleweed
Join Date: Jun 2006
Location: Hawaii
Posts: 6,038
|
The only other thing, I guess, could be that the website code could be written badly and it keeps mysql connections open longer than it really needs to?
Have you got MySQL doing any caching? http://www.databasejournal.com/featu...le.php/3110171
__________________
Mal: Define "interesting"? Wash: "Oh, God, oh, God, we're all gonna die"? |
14-02-2007, 22:27 | #6 | ||
Moonshine
Join Date: Jul 2006
Location: Nr Liverpewl
Posts: 4,371
|
Quote:
Quote:
|
||
05-03-2007, 16:21 | #7 | |
Moonshine
Join Date: Jul 2006
Location: Nr Liverpewl
Posts: 4,371
|
Right. I've looked into this a lot more now. Here's the deal. Wordpress doesn't forceably close MySQL connections because non-persistant connections are automatically closed at the end of a scripts execution. So I told my host that and they said;
Quote:
|
|
05-03-2007, 23:45 | #8 |
Preparing more tumbleweed
Join Date: Jun 2006
Location: Hawaii
Posts: 6,038
|
In other words, lazy programming. All it takes is a single command to close the connection, and they could have used it.
__________________
Mal: Define "interesting"? Wash: "Oh, God, oh, God, we're all gonna die"? |
06-03-2007, 12:01 | #9 | |||
Moonshine
Join Date: Jul 2006
Location: Nr Liverpewl
Posts: 4,371
|
Quote:
Quote:
Quote:
|
|||
05-03-2007, 22:35 | #10 | |
Screaming Orgasm
Join Date: Jul 2006
Location: Newbury
Posts: 15,194
|
Quote:
|
|