Bug 46996 - "MaxClients reached" message can occur with many threads still idle
Summary: "MaxClients reached" message can occur with many threads still idle
Status: CLOSED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mpm_worker (show other bugs)
Version: 2.2.14
Hardware: All All
: P4 trivial (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: FixedInTrunk, PatchAvailable
Depends on:
Blocks:
 
Reported: 2009-04-08 09:54 UTC by Dan Poirier
Modified: 2010-02-19 12:55 UTC (History)
0 users



Attachments
Patch to delay the message and issue a different one earlier (2.10 KB, patch)
2009-04-08 09:54 UTC, Dan Poirier
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Poirier 2009-04-08 09:54:34 UTC
Created attachment 23462 [details]
Patch to delay the message and issue a different one earlier

The "MaxClients reached" message occurs as soon as the number of idle threads drops below MinSpareThreads.  If MinSpareThreads is set large for some reason, there could still be a lot of idle threads so the message is misleading.

The attached patch saves the "MaxClients reached" message until there are no idle threads, which seems more accurate.  It issues a new message when the number of idle threads drops below MinSpareThreads.  Neither message will be issued more than once per child.
Comment 1 Sean Thorne 2010-01-20 09:57:44 UTC
This issue also exists in 2.2.14.  It's incredibly misleading to have it print MaxClients has been reached when it's really just below the MinSpareThreads.  Especially if you run a config with a high MinSpareThreads number.  I would recommend that it say something like "the number of idle threads has dropped below the min spare thread number".  That would make it easier for people not 100% familar (like myself :) ) with the code capable of tracking down issues.
Comment 2 Stefan Fritsch 2010-02-03 14:01:44 UTC
(In reply to comment #0)
> The attached patch saves the "MaxClients reached" message until there are no
> idle threads, which seems more accurate.  It issues a new message when the
> number of idle threads drops below MinSpareThreads.  Neither message will be
> issued more than once per child.

Dan, is there a reason why you haven't commited that patch, yet?
Comment 3 Dan Poirier 2010-02-04 08:02:57 UTC
Just forgot about it since getting committer.

Committed to trunk, r906535

As I recall, fixing it in 2.2.x looked a little more complicated.
I'll take a look at that next.
Comment 4 Dan Poirier 2010-02-19 12:55:18 UTC
Backported to 2.2.x as r910320