Posted by Madhusudan S on 18 May 2015 04:33:38 PM
The efficiency with which Apache runs can greatly be improved with a few small tweaks in the Apache configuration file. Below are the major parameters that can be tweaked to improve the performance of the server.
KeepAlive On : This directive “KeepAlive” if set to “On”, enables persistent connections on the web server. For better performance, it’s recommended to set this option to”On” and allow more than one request per connection. In the original HTTP specification, every HTTP request had to establish a separate connection to the server. To reduce the overhead of frequent connects, the keep-alive header wasdeveloped. Keep-alives tells the server to reuse the same socket connection
MaxKeepAliveRequests : This directive”MaxKeepAliveRequests”is used to define the number of requests allowed per connection when the KeepAlive option above is set to”On”. Socket connections will be terminated when the number of requests set by the
KeepAliveTimeout : This directive “KeepAliveTimeout” is used to define how much time, in seconds, Apache will wait for a subsequent request before closing the connection. Once a request has been received, the timeout value specified by the “Timeout”
StartServers : This directive “StartServers” is used to define the number of child server processes that will be created by Apache on start-up. As the number of processes with Apache 2.x is dynamically controlled depending on the load,
MaxClients : This directive “MaxClients” is used to define the limit on the number of child processes that will be created to serve requests. The default means that up to 512 HTTP requests can be handled concurrently. Any further connection requests
ServerLimit : This directive “ServerLimit” is used to define the maximum configured value for the “MaxClients” directive for the lifetime of the Apache process. It is important to note that any attempts to change this directive during a restart
MinSpareServers 10 : This directive “MinSpareServers” is used to define the minimum number of idle child server processes that should be created. An idle process is one which is not handling a request. If there are fewer than “MinSpareServers” idle, then
the parent process creates new children at a maximum rate of 1 per second.
MaxSpareServers 15 : This directive “MaxSpareServers” is used to define the maximum number of idle child server processes that should be created. If there are more than “MaxSpareServers” idle child processes, then the parent process will kill off
MaxRequestsPerChild 9999 : This option “MaxRequestsPerChild” is used to define the number of requests that an individual child server process will handle. This value can be set to “0” to get the maximum performance and scalability for the server. This is an important tuning parameter regarding the performance of the Apache web server again.