In corporate website in order to avoid prolonged occupation with a client connection, waste of resources, you can set the appropriate
connection timeout parameters to achieve control connection access time.
keepalived_timeout: holding connection timeout provided, generally only the parameter can be set, by default 75 seconds, according to the
setting situation of the site, or closed, at http segment, server segment or segments disposed location.
client_header_timeout: Specifies the time the client sends a request timeout header.
client_body_timeout: setting a read request body timeout.
If a timeout occurs, it will return 408 error
[root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf
In the following three http add command
keepalive_timeout 65;
client_header_timeout 60; // wait for client timeout head 60 seconds
client_body_timeout 60 ; // wait for client timeout period is 60 seconds body
[root@localhost ~]# killall -s HUP nginx
===================================================================
In high concurrency scenarios, we need to start the process to ensure more rapid impact nginx to handle the user's request, to avoid
causing obstruction
worker_processes parameter modification profile, disposed generally double the number of CPU cores, or the number of
[root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf
worker_processes 2; //cpu核数
worker_cpu_affinity 0001 0010 //cpu分配