Apache Configuration Parameter Description

Apache Configuration Parameter Description

(1)keepAlive On/Off

 keepAlive refers to keep the connection active, in other words, if KeepAlive is set to On, then the requests from the same client does not need to connect once again, to avoid each request must create a new connection and increase the burden on the server. In general, more pictures of the site should be set KeepAlive On.

(2) KeepAliveTimeOut number
exceeds the time KeepAliveTimeout, then, the connection between the first and second request if the first request is interrupted, then the new second connection. It is generally provided to picture or the like JS file twice request intervals, usually set to 3-5 seconds.

(3) MaxKeepAliveRequests 100
the maximum number of requests that can be connected to a HTTP request. Its value is set to 0 will support an unlimited number of transmission request in the first connection.
In fact there is no client requests a connection in too many pages, usually reach this limit to complete the connection.

(4) HostnameLookups on | off | double
If you are using on, then only conduct a reverse lookup, but also to conduct a forward resolution after if double, then anti-check, only the results of the two in line with each other
for the job and off The domain is not verified.
If, for safety, it is recommended to use double; For faster access, it is recommended to use off
the domain name lookup turn this will increase the burden on Apache, slow down the access speed of the proposed closure

(5) timeout 5
Top 5 Apache this is to accept the request or issue the appropriate time over this time OFF

Note: The
above configuration items can be set by reference in /usr/local/http-2.4.23/conf/extra/httpd-default.conf and include options in the httpd.conf file


MPM more crucial this is the main factor affecting the efficiency of concurrency:

(1) StartServers 10
the number of child processes created when the server starts to set. Because of the severity of the number of child processes dynamically depending on the load, it is generally not necessary to adjust the parameters.

(2) MinSpareServers 10
to set the minimum number of idle child processes. The so-called idle child process refers to the child process requests not being processed. If the current is less than the number of child processes idle MinSpareServers, then a second maximum speed Apache will produce a new child process. It is adjusted only on a very busy machine. This parameter is set too high is usually a bad idea.

(3) MaxSpareThreads 75
to set the maximum number of idle child processes. If you currently have more than the number of child processes MaxSpareServers idle, then the parent process will kill the unwanted child. It is adjusted only on a very busy machine. This parameter is set too high is usually a bad idea. If you command value is smaller than the setting MinSpareServers, Apache will automatically be modified to "MinSpareServers + 1".

(4) ServerLimit 2000
server allows the maximum number of process configurations. You only need to set MaxClients higher than the default value of 256 when it is required. To keep the value of this directive and MaxClients same. Modify the value of this instruction must stop the service before you start to take effect, restart to restart it will not take effect.

(5) MaxClients / MaxRequestWorkers 256
maximum number of requests (the maximum number of child processes) for client requests, and any request exceeds the limit MaxClients will enter the waiting queue. The default value is 256, if you want to increase this number must increase the value of ServerLimit. It recommends an initial value (in MB physical memory Maximum / 2), and then dynamically adjusted according to the load.

4G memory such as a machine, then the initial value is 4000/2 = 2000.

(6) MaxRequestsPerChild / MaxConnectionsPerChild 0
sets the number of requests for each sub-process can be processed, the processing of each sub-process "MaxRequestsPerChild" request will be automatically destroyed. 0 means unlimited, that the child process never destroyed. Large memory server may be set to 0 or a higher number. Memory smaller servers may wish to set to 30,50,100. Therefore, under normal circumstances, if you find that the increase in server memory straight, it is recommended to modify the parameters to try.

Note: The
above configuration items can be set and referenced by include options in the httpd.conf file in /usr/local/http-2.4.23/conf/extra/httpd-mpm.conf.

4. Turn the Apache Gzip (deflate) function:
gzip can greatly speed up the site, and sometimes higher compression ratio to 80%, at least there are more than 40%, is still quite good.
 In later versions of Apache2, the module name is not called gzip, and called mod_deflate

Unused Gzip

Guess you like

Origin www.linuxidc.com/Linux/2019-07/159584.htm