How do MaxSpareServers work in Apache?

9,793

If somehow there are less spare server processes than MinSpareServers, Apache will attempt to create spare server processes until they are at least MinSpareServers.

If you have load on your server, Apache will create more server processes up to MaxClients. As long as they are in use they will not be killed, but if the load drops, Apache will start killing the processes until there are at most MaxSpareServer processes left.

Share:
9,793

Related videos on Youtube

John Hunt
Author by

John Hunt

Updated on September 18, 2022

Comments

  • John Hunt
    John Hunt almost 2 years

    I've scoured the web but I can't find out what MaxSpareServers are in Apache MPM prefork..

    The MaxSpareServers directive sets the desired maximum number of idle child server processes. An idle process is one which is not handling a request. If there are more than MaxSpareServers idle, then the parent process will kill off the excess processes.

    Great, but what causes a spareserver to be created? More importantly, when does a spare server go away? I understand that minspareservers are created gradually after the server is started..

    How do maxspareservers relate to maxclients?

    Basically I'm at a bit of a loss on how best to configure Apache.. there's a lot of documentation out there but it isn't that clear.

    Thanks, John.

  • John Hunt
    John Hunt over 11 years
    ok, I think I get it :)
  • OZZIE
    OZZIE over 10 years
    When load drops of and stays down will it also kill processes until it reaches MinSpareServer ?
  • Christopher Perrin
    Christopher Perrin over 10 years
    I'm not sure but I think it doesn't. I believe that the lower bound is for when you set the maximum requests for a server.