I had my first experience with a ’too many connections’ error message on a client site today.
I’ve looked through the forums, and there doesn’t seem to be any consensus on whether or not there is actually an issue with MODx on this matter. I’ve seen some vague solutions mentioned in the forums. One suggestions was to turn off logging and stats. OK, but these are not even turned on on my site.
Has any tried typing "modx too many connections" into Google. The interesting result is that instead of getting support threads about the ’too many connections’ problem you will instead see a long list of live sites which have suffered the ’too many connections’ problem. And even if the site is available when you click through, you at least know that it was affected at the time when Google crawled it.
If you go directly to the forums, and search for ’too many connections’ there are a couple of pages of responses, but nothing concrete for me to go on. If Drupal and OSCommerce can manage without causing this kind of error, why can’t MODx. I find this frustrating because I feel like there is not much I can do to prevent this happening again, and therefore inevitably there will be a call coming in from an angry client.
So it seems to me that the MODx community might be in denial about the problem.
So my questions:
* What precisely in MODx is causing the problems?
* Is there something that can be done to patch MODx to prevent these errors in the future?
* Are there any plans by the MODx dev team to review the MODx database API in the future?
Thanks
Subd
-
MODX Staff
- 12,272 Posts
Googling for MODx too many connections = ~1410 results
Googling for oscommerce too many connections = ~3920 results
Googling for Drupal too many connections = ~13,800 results
I’d be willing to wager that you’re simply running your site on an overloaded shared server or an improperly configured MySQL server.
Where is your client site hosted?
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
-
☆ A M B ☆
- 24,524 Posts
It can also be caused by poor configuration of Apache and Mysql and persistant connections. If an Apache thread finishes, but the pconnect timeout is too long, the connection to the database will still be open and cannot be re-used until it times out. If this happens too many times, you’ve got all those orphaned database connections hanging around and that can very quickly bring the database to its knees.
Just a cursory look at a couple of quick Google searches would have made it clear this is not a MODx problem.