Jump to content

SQLSTATE[42000] [1226] User 'www' has exceeded the 'max_user_connections' resource (current value: 30)


Recommended Posts

Hi there,

On one site (on tsohost.com) i get this error message that I'm using too many db connections. The site will hang for half a minute then work again.

I wonder, is max 30 low, or normal? It's the first time in a decade I encounter this issue in PW. I'm doing some custom logging so i do new Page() and ->save() for some pages, could this mess with the db connection pooling? Do i need to explicitely close any connections?? I would imagine I don't need to do anything like that, or?

many thanks J

Link to comment
Share on other sites

The max number is relative to the size and availability of your database server. It also depends on how you set up your front-end output.

For a short term solution, the first thing you need to do is to cache your front-end output as much as possible (without compromising the freshness of content of course). You can either use template caching or ProCache.

Since you are on a shared host, you are at the mercy of the pool of sites/apps that are on the same vm. If you have the budget or want to have more control over how resources are being allocated, you might want to consider running your site on your own VPS. DigitalOcean, Linode, AWS to name a few. There are server provisioning management services out there that can help you with the set up. RunCloud, ServerPilot or Forge are some good examples.


  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...