I am running a web application on a CentOs 6 machine with 4 gigs of memory and 3 processor cores (Intel Xeon 2.9 Ghz).
Every morning between 8.30 and 9.30 AM (which coincides with the time period when most people come in to work and start using this application), Apache stops taking any new requests because the MaxClients setting crosses 256 (which was the default).
At any given point, I have 15 users using the application and the times of activity on this application are between 8.30 AM and till about 4.30 PM.
To try and understand what may be causing this
MaxClients setting to be surpassed, I started monitoring how many requests my machine is making to the server during and after the page has loaded. About 40 minutes of monitoring resulted in this:
As can be seen, my web application use CometChat to allow users to interact with each other and AFTER page load, all activity is coming from CometChat making AJAX requests to get updates.
Just now, I ran this command in shell to get the number of
apache threads running:
pidof httpd | wc -w
The result was: 245. This number consistently rises after I restart Apache. The average (resident) memory taken up by these processes is about
245 processes with 18M per process results in more than 4 gigs of RAM usage.
Now, for my questions:
- Is my client (or CometChat on behalf of my client) making too many requests? Is the amount of data being transferred unusually high?
- What do I do to prevent the
MaxClientssetting to be surpassed?
This is a low traffic time for us. In the coming months, traffic will only increase. Any help is appreciated !