1

I've got Apache installed with the worker mpm which seems to have too many processes active in spite of the configurations in place. I'll detail the configs below :

StartServers 2
MinSpareThreads 10
MaxSpareThreads 25
ThreadsPerChild 25
MaxClients 150

Based on these settings, we should be seeing a maximum of 1 Apache control process (uid:root) and 6 Apache client processes (uid:www). This being due to MaxClients/ThreadsPerChild.

However, I'm seeing a total of 1 Apache control process and 9 Apache client processes.

init
-- apache2(root)
-- -- apache2(www)
-- -- apache2(www) -- 1 thread
-- -- apache2(www) -- 26 threads
-- -- apache2(www) -- 26 threads
init
-- apache2(www) -- 2 threads
-- apache2(www)
-- apache2(www)
-- apache2(www)

We do not make it a habit of restarting Apache nor the Server, and will perform a reload 2-3 times a day at times so as to add new VHOSTs.

Would anyone be able to enlighten me as to what might be causing this ? enter code here

jonathanserafini
  • 1,768
  • 14
  • 20

1 Answers1

1

MaxClients doesn't determine the number of child processes - the number of child processes multiplied by the number of ThreadsPerChild determines the maximum acceptable value of MaxClients.

To meet your values of 6 child processes and 150 maxclients, use the following settings:

StartServers 2
ServerLimit 6
MinSpareThreads 10
MaxSpareThreads 35
ThreadsPerChild 25
MaxClients 150

Note also that I modified the MaxSpareThreads value. From the documentation:

The range of the MaxSpareThreads value is restricted. Apache will correct the given value automatically according to the following rules:

* mpm_netware wants the value to be greater than MinSpareThreads.
* For worker the value must be greater or equal than the sum of MinSpareThreads and ThreadsPerChild.
sh-beta
  • 6,838
  • 7
  • 47
  • 66
  • Thanks for the info on MaxSpareThreads, I will go ahead and get that updated. However, I would be interested to know where you got the information for the first comment about MaxClients. Per the HTTPD documentation[1] on Apache MPM Worker : The maximum number of active child processes is determined by the MaxClients directive divided by the ThreadsPerChild directive. [1]: http://httpd.apache.org/docs/2.1/mod/worker.html – jonathanserafini May 26 '10 at 20:32
  • I suspect "Active child processes" means "Child processes actually doing work." The docs for ServerLimit[1] read "For the worker MPM, this directive in combination with ThreadLimit sets the maximum configured value for MaxClients for the lifetime of the Apache process." The wording needs work. [1]: http://httpd.apache.org/docs/2.1/mod/mpm_common.html#serverlimit – sh-beta May 26 '10 at 20:43
  • Yup, I've got to agree with that. Well, off to go testing. Thanks a bunch. – jonathanserafini May 26 '10 at 20:49