We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22098
    • 218 Posts
    Hello,

    we are running some heavy traffic sites using MODx. We are using opcode-caching, MODx caching to optimise these sites. But still with some heavy peaks in traffic we get the MODx error message that the max number of connections to mysql is reached and MODx cannot connect to the database.

    How can we avoid this kind of error message? I rather have people getting a browser time-out error than a MODx database error message.

    Does MODx use mysql_pconnect (persistent connects) by default for it’s pages and cache use? If so, this might be causing some of the trouble, but when scanning the code it seems that MODx default does not use persistent db connects?

    Olaf
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Either increase the number of connections allowed by your MySQL server’s configuration, or add another server. There comes a time when no amount of tweaking of the software will cover inadequate hardware.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 22098
        • 218 Posts
        Quote from: sottwell at Jun 25, 2009, 06:24 AM

        Either increase the number of connections allowed by your MySQL server’s configuration, or add another server. There comes a time when no amount of tweaking of the software will cover inadequate hardware.

        what about limiting the max number of connections in Apache, and having the max limit of connections of mysql lower or the same as this setting. Would that avoid creating MODx database connect error messages?

        Olaf