Jump to content

MySQL max_connections question/suggestion

Recommended Posts

Hi -

Last two days I ran in to the max_connections limited set in my.cnf. Only because of this did I learn about this setting and make some adjustments. The value was set at 150 and I bumped it to 500. However, I have a question regarding this number:

I have google analytics installed so I watched the traffic in real-time (ie. not using the 15 minute IPB online user count, but the real online user count). Both times that I ran into the max_connections, I only had around 80 users on my site.

In the J2EE world, we normally use a connection pool. So, say you have a pool of 10 connections, you could probably support 100 users (making up the ratio here but you get the idea). I assumed PHP works the same way...but if so, how can 80 active users on the site consume more than 150 connections. I would have thought that 80 users would only need around 8-10 mysql connections...but as it looks right now its almost a 2:1 mapping in reverse. Every user taking two connections. However, this is not always the case.

Would love if someone can explain that to me and what a good rule of thumb is for setting that max_connections. I should note that both times right before I ran into the max_connections issue my server load spiked even though the users was only around 80. I don't know if there is any correlation between those two events (max_con and server load spiking).

Anyway, any explanation on max_connections and any recommended values would be appreciated.



Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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