[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How do you approach the problem of "MaxClients reached" with apache?



On Wed, Feb 22, 2012 at 12:39 PM, Karl E. Jorgensen
<karl.jorgensen@nice.com> wrote:
> On Wed, 2012-02-22 at 14:05 +0000, francis picabia wrote:
>
> Hello,
>
> One of the most frustrating problems which can happen in apache is to
> see the error:
>
> server reached MaxClients setting
>
> After it, the server slowly spirals down.  Sometimes it mysteriously
> recovers.
> This is difficult to diagnose after the problem appeared and went away.
>
> What have we for advice on :
>
> a) diagnosis of the cause when the problem is not live
> b) walling off the problem so one bad piece of code or data does not
> effect all sites hosted on same server
>
>
> To diagnose it, enable server-status - this gives you a URL in apache where
> you can see how many workers are busy, how many requests are being served
> etc. You want to tie this into your monitoring system.

I've never tried this.  I'll need to see if it can be polled by cacti
or something.
It seems when the problem often happens, there is no one in the office.

> As for increasing capacity you need to read the docs for the MPM worker
> you're using - for example:
> http://httpd.apache.org/docs/2.2/mod/prefork.html for the pre-forking
> server.

Capacity isn't the issue, but finding the source for the runaway
train/fire, whatever
analogy makes sense for you.

Another thing I've looked at is logging more detail. The LogFormat
can include %T, %I and %O to show the time elapsed in response,
the input bytes and output bytes.  I suspect if we look back in
the logs while using the enhanced logging, and see some of
these values rise we will have an idea where the lag is beginning.


Reply to: