nginx.conf配置:
worker_processes 8;
worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;worker_rlimit_nofile 204800;
error_log /home/work/orp/log/error_log debug;
pid /home/work/orp/var/nginx.pid;events {
use epoll;
worker_connections 204800;
}http {
-- 省略具体的配置
}
启动执行过程:
启动命令:
/usr/bin/nginx
或者
/usr/bin/nginx -t -c ~/mynginx.conf -g "pid /var/run/nginx.pid; worker_processes 2;"
执行过程:
master读取nginx.conf、执行配置中命令->启动worker进程
Hup执行过程:
nginx -p /home/work/nginx_dir/ -s reload
重新读取配置->启动worker进程(worker进程的数量是nginx.conf中配置的)->结束之前的worker进程
停止执行过程:
kill -s QUIT $pid
结束worker进程