Debian – What values to set for Apache 2 worker server pool management

apache-2.2configurationdebianmpm-workerperformance

I recently switched from Apache 2.2 prefork to Apache 2.2 worker, but I have no idea what would be a great MPM config to start with. On prefork, I used :
MaxClients 256
StartServers 190
MinSpareServers 160
MaxSpareServers 220

I'd like to be able to accept at least as much simultaneous requests (190)

Thanks !

PS: Server environment: Debian 5.0, 2x 3.00 Ghz, 4 GB RAM, dedicated to Apache.

Best Answer

ServerLimit 256
MaxClients 256
StartServers 19
ThreadsPerChild 10
MinSpareThreads 160
MaxSpareThreads 220
MaxRequestsPerChild 10000

This will:

  • Start 190 threads when httpd starts
  • Serve up to 256 simultaneous requests
  • Ensure a min of 160 spare threads
  • Limit a max of 220 spare threads
  • Limit each httpd child process to serving 10,000 requests before replacing it with a new child process. This helps prevent hanging up the apache server in case there are memory leaks in the underlying application.