MySQL Forums
Forum List  »  PHP

Re: Too Many Connections - MySQL - 2GB RAM
Posted by: Rick James
Date: July 18, 2014 03:23PM

Adding RAM is advisable before increasing max_connections. 2GB is tiny in today's world.

However, the better solution would be to figure out why each web page is taking so long.

An efficient web page will be finished in, say, 0.4 sec.
You have max_connections = 200.
That says it can create 500 (200/0.4) web pages per second, which is 30,000 per minute. Are you really generating that many web pages? Or is each page taking a long time to build?

Look for the slowest page; see what SQL statements are being used. Then try to improve on them. Bring the details to us for help, if you like.

> 100 users simultaneously using the website
That is not a useful metric; what is needed is how long each page has an open connection. This is harder to measure.

Look at SHOW GLOBAL STATUS LIKE 'Max_used_connections' to see how many "users" were _connected_ at the peak (since MySQL was last restarted). If that value is getting close to max_connections, then the advice above is relevant.

Options: ReplyQuote


Subject
Written By
Posted
Re: Too Many Connections - MySQL - 2GB RAM
July 18, 2014 03:23PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.