Apache MaxClients vs ServerLimit

I do not understand what the difference is between ServerLimit and MaxClients in a prefork environment.

I understand MaxClients is the total number of apache processes that will be spawned to serve users. The manual for serverlimit says:

For the prefork MPM, this directive sets the maximum configured value for MaxClients for the lifetime of the Apache process. For the worker MPM, this directive in combination with ThreadLimit sets the maximum configured value for MaxClients for the lifetime of the Apache process. Any attempts to change this directive during a restart will be ignored, but MaxClients can be modified during a restart.

…"for the lifetime of the Apache process". What the heck does that mean?

2 Replies

My (possibly incorrect) understanding is that ServerLimit for prefork is a hard limit that can only be changed by stopping and starting Apache.

For example, say you have MaxClients=10 and ServerLimit=100. If you want to change MaxClients to 50, you can just edit the config file and send a HUP signal (or USR1) to the main Apache process, and the change will take effect. However, if you want to set MaxClients to 1000, you must completely stop Apache and restart it. (You would of course need to increase ServerLimit accordingly first.)

I honestly don't know what would happen in the MaxClients=1000 case - I guess Apache would either ignore the change, or set MaxClients to be 100.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct