nginx优化worker进程最大打开文件数worker_rlimit_nofile 65535

版权声明:转载请注明出处,否则自行负责所有后果 https://blog.csdn.net/ljx1528/article/details/87362561

性能优化-优化worker进程最大打开文件数worker_rlimit_nofile 65535;
参数语法:worker_rlimit_nofile 65535;
默认配置:无
放置位置:主标签段,不在任何区块
在主配置文件nginx.conf中配置

host-192-168-1-15:/usr/local/nginx/conf # cat /usr/local/nginx/conf/nginx.conf
worker_processes  2;
error_log logs/error.log;
 
#配置Nginx worker进程最大打开文件数
worker_rlimit_nofile 65535;    #添加的
 
user www www;
events {
    #单个进程允许的客户端最大连接数
    worker_connections  20480;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    #访问日志配置
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
 
    #虚拟主机
    include /application/nginx/conf/extra/www.conf;
    include /application/nginx/conf/extra/blog.conf;
    include /application/nginx/conf/extra/bbs.conf;

    #隐藏版本号
    server_tokens on;
}

猜你喜欢

转载自blog.csdn.net/ljx1528/article/details/87362561
今日推荐