nginx性能调优参数

worker_processes 8;
worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;
worker_rlimit_nofile 204800;
error_log /opt/nginx/log/error.log warn;
pid /opt/nginx/nginx.pid;

events {
use epoll;
worker_connections 65535;
}

http {
include /opt/nginx/conf/mime.types;
default_type application/octet-stream;
client_max_body_size 5000M;
log_format main ‘$remote_addr – $remote_user [$time_local] “$request” ‘
‘$status $body_bytes_sent “$http_referer” ‘
‘”$http_user_agent” “$http_x_forwarded_for”‘;
access_log /opt/nginx/log/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
server_tokens off;
keepalive_timeout 600;
client_header_buffer_size 4k;
large_client_header_buffers 4 8k;
open_file_cache max=204800 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 1;
keepalive_requests 100000;
client_header_timeout 180;
client_body_timeout 180;
reset_timedout_connection on;
client_body_buffer_size 128m;
proxy_connect_timeout 300s;
proxy_send_timeout 900;
proxy_read_timeout 900;
proxy_buffers 4 128k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
include /opt/nginx/conf/conf.d/*.conf;
}

发表评论

电子邮件地址不会被公开。 必填项已用*标注