MySQL Max Connections in Shared Hosting Environment

MySQLshared-hosting

I am having trouble with a website that I am responsible for, which is on a shared hosting plan. I'm unable to establish a database connection because there are too many in use. These lockouts (usually) line up with new events on the site, such as blog posts or tweets announcing blog posts.

When I connected to the database and asked for the value of the 'max_connections' variable, I found that it was set to 100.

SHOW variables LIKE 'max_connections';

I feel a bit silly asking this. Shared hosting means shared resources, it's right there in the name. But I'd like to confirm that this value that I'm getting is server-wide and not specific to my account. Is my site reaching this number all on its own, or is it just one part of the problem?

Best Answer

Maximum number of connections in MySQL can be limited globally, per user and per hour.

max_connections is global limit, max_user_connections for user.

Default max_connections is set to 100, if not changed from my.ini.

Related Topic