Wednesday, 4 May 2016

How to optimize Apache configuration ?


Settings can be done in conf / httpd.conf

Timeout

  • Amount of time Apache will wait to receive TCP packets and acknowledgements for a request
  • Default : 300 (sufficient)
  • Recommended for virtualized servers : 100  =>  improves performance

KeepAlive
  • makes KeepAlive setting ON or OFF
  • Possible settings : “KeepAlive off” or “KeepAlive on

MaxKeepAliveRequests
  • Max number of requests a single persistent connection will serve.
  • used when KeepAlive is On
  • Set to 0 = Unlimited requests
  • Recommended for virtualized servers : 100  and Dedicated server : 150

KeepAliveTimeout
  • Number of seconds Apache will wait for another request before closing the connection
  • Recommended : 1 to 5 (Avoids wasting RAM while waiting for requests)
  • Default : 15 (at higher side)
  • High value = Performance issue in servers having heavy load

MinSpareServers
  • Minimum number of idle child server processes (idle = not handling a request)
  • Recommended :
    • For virtualized server (Default) = 5
    • For Dedicated server with 2 GB RAM = 10
    • For Dedicated server with 4 GB RAM = 20
    • For Dedicated server with 4+ GB RAM = 25

MaxSpareServers
  • Max number of idle child server processes 
  • Default : 10
  • Recommended : Double of value set for MinSpareServers

StartServers
  • Number of child server processes created on startup
  • Default : 5
  • Recommended : Same as value set for MinSpareServers

MaxClients
  • Limit on the number of simultaneous requests that will be served
  • Connection more than limit, will be in queue and wait for other processes to finish.
  • Default : 150
  • Recommended for virtualized server = 150 and dedicated server = 250

MaxRequestsPerChild
  • Limit on the number of requests that an individual child server process will handle
  • After number of requests reaches more than limit, child process will die.
  • Default : 0 = process will never expire
  • Recommended :
    • For virtualized server = 300
    • For Dedicated server with 1 to 4GB RAM = 500
    • For Dedicated server with 4+ GB RAM = 1000

No comments:

Post a Comment

Note: only a member of this blog may post a comment.