nginx 全局配置

nginx 全局配置

#user nobody;
# user 主模块 ,指定nginx worker 进程的运行用户组
worker_processes 1;
# worker_processes 开启进程数 每个nginx进程平均消耗 10-12内存 (CPU 和内核进程数一样)

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
# error_log 日志输出级别 ;有 debug info notice warn error crit

#pid logs/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 65535;
# worker_rlimit_nofile nginx进程打开的最多文件描述符数目 65535 (ulimit -n 65535 设置)

events {
use epoll;
worker_connections 1024;
}

events {
use epoll;
worker_connections 1024;
}
  // events 设置工作模式和设置连接数;
  // 默认是 use epoll;
  // 指定nginx的工作模式标准和高效模式:select Poll 标准 和 kqueue epoll rtsig /dev/poll高效)


worker_connections 65535;
  // 事件模块,定义内个进程的最大连接数;
  // 最大客户端的链接数一般由 worker_processes 和 worker_connections 决定的;max_clinet = worker_processes* worker_connections
  // 在作为反向代理时变为 max client =worker_processes*worker_connections/4

 

 

posted @ 2017-11-17 13:12  01234567  阅读(678)  评论(0编辑  收藏  举报