On Monday 11 April 2016 18:12:43, Eric Covener wrote:
> On Mon, Apr 11, 2016 at 4:59 PM,  <bugzi...@apache.org> wrote:
> > ServerLimit >= 10 * MaxRequestWorkers / ThreadsPerChild
> 
> Hi Stefan -- I am curious -- prior to the recent patches, just
> having the extra capacity in ServerLimit didn't help / didn't help
> as much?

No, without the patches attached to the PR, ServerLimit does not play 
any role for this issue. Only the scoreboard entries up to 
(MaxRequestWorkers / ThreadsPerChild) will ever be used.

The state in 2.4 is that scoreboard entries of processes where some 
threads have already terminated would get re-used, but there is no 
code that terminate threads before the whole process terminates.

In trunk, I have added logic to terminate threads as soon as possible 
during graceful finishing of a process. But the reason for that is 
that I want old processes to use as few resources as possible. I am 
not sure that new processes re-using the scoreboard entries of those 
threads is a good idea. In the worst case, you could get 
ThreadsPerChild processes that each use one worker slot in the 
scoreboard area of a single process.

Maybe it would be better to remove the logic to re-use scoreboard 
slots of processes which have already terminated some threads. 
Instead, one could use the scoreboard area abore (MaxRequestWorkers / 
ThreadsPerChild) more aggressively, and maybe even allocate some 
additional slack space at startup. There could be these config knobs:

- the max number of fully active processes (ServerLimit)

- the max number of gracefully finishing processes ("OldServerLimit"?)

- what to do if OldServerLimit is reached during a graceful restart:
  * reduce the max number of fully active processes accordingly
  * kill off old processes

- what to do if OldServerLimit during normal operation:
  * stop doing idle-cleanup of fully active processes [X]
  * kill off old processes

Hmm. Now that I think of it, I think we should really do [X] if there 
are too many old processes. The only question is how to define too 
many.

Any thoughts?

Reply via email to