MyBB Community Forums

Full Version: 'max_user_connections' Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I received a number of MyBB errors stating "User 'myusername' has exceeded the 'max_user_connections' resource (current value:  30)"

Is this affecting my registered users on MyBB?  What is it affecting?

How could I exceed my amount of connections?  I use "myusername" for 2 MyBB's, but I'm not sure what I am doing to exceed 30 connections.  Can anyone tell me how this is happening and what I can do not to get that error?  I'm not sure what it means and tried to search for information on it.


Thanks.
There's just too many users connecting to the database than your host allows, you'll need to contact your host about this. Are you on shared hosting?
Don't rely on registered members or real human visitors - most of the visits are automated bots that crawling your site. So it is possible that bots are massively raising the number of sessions in your forums.

As Matt mentioned - either increase the sessions limit in you database configuration or ask your hosting service to do so.

For investigation of this issue:
How many online users do you have in such a peak time?
Usually a moderate powered webserver is able to handle a big bunch of MyBB forum transactions with no bottleneck.
Do you running other webservices on the same web/database server with long transactions queries?

[ExiTuS]
Thank you both for the replies. I will check with my web host. I am on shared hosting. I didn't realize I would be limited to the number of users I could have on at one time through my username for MySQL database. The error always shows my database username.

I have that username on two different databases. If I create a different username, will that help? Or can I only have 30 users on my websites across my hosting account? I had a different forum before, and I never got this error, so I'm confused why I am getting it with this one. I can have about 30 users and 30 guests on at one time, and that number is going to keep growing.
Shared hosting will typically have low settings for things like this because they're sharing resources across possibly hundreds of customer hosting accounts. A MySQL connection is only open for a short time while the rest is being processed, but the max connections setting is configured for MySQL as a whole, which means that if there's lots of other hosting accounts using the same MySQL server, that limit is going to be hit pretty quickly. It's a common issue with shared hosting.
CookieMonster217 Wrote:I have that username on two different databases. If I create a different username, will that help? Or can I only have 30 users on my websites across my hosting account?
Different usernames do not solve.
This issue only depends on open connections (sessions) to the database accross the whole MySQL server.

CookieMonster217 Wrote:I had a different forum before, and I never got this error, so I'm confused why I am getting it with this one. I can have about 30 users and 30 guests on at one time, and that number is going to keep growing.
As long as more than 30 visitors do not have an open connection to the database in parallel, your database server can serve unlimited visitors.
A database connection (session) is just for the moment of a transaction and is closed immediately after (to release the session again).

If it's worth the effort and if you have the chance, look into the server logs for a detailed investigation. Maybe you can figure out unreleased sessions. I bet on MyBB is clean and strict in handling database connections.

[ExiTuS]
This looks to be a per-user limit, not a per-server limit. Check the error message in the OP (emphasis added): "User 'myusername' has exceeded the 'max_user_connections' resource (current value:  30)".
I think that's what it always says, my understanding is that's just telling you which user got the error. The setting is configured in the my.cnf file, I've never seen a way to set a limit per-user before.
Oh, yes you can set a limit per-user per-hour, but I'm pretty sure that gives a slightly different error message. Will need to ask the host either way as it won't be something that can be changed with shared hosting and it's unlikely using a different user for each site will be a long term solution.
Yep, either way, it's a limitation of shared hosting.
Pages: 1 2