多个Nginx主进程
当我使用以下命令运行我的nginx服务器时:多个Nginx主进程,nginx,Nginx,当我使用以下命令运行我的nginx服务器时: /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf 我有两个主进程 root 11632 2.6 0.1 76164 1372 ? Ss 01:30 0:06 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf www
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
我有两个主进程
root 11632 2.6 0.1 76164 1372 ? Ss 01:30 0:06 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
www 14515 3.0 24.0 319920 245060 ? S 01:35 0:00 nginx: worker process
www 14516 3.0 24.0 319920 245060 ? S 01:35 0:00 nginx: worker process
www 14517 3.0 24.0 319920 245232 ? S 01:35 0:00 nginx: worker process
www 14518 0.0 6.5 319920 66544 ? R 01:35 0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
我的nginx.conf的一部分:
user www www;
worker_processes 4;
error_log /data/logs/nginx_error.log crit;
pid /usr/local/nginx/logs/nginx.pid;
worker_rlimit_nofile 600000;
events
{
use epoll;
worker_connections 600000;
}
当worker|u进程少于4个时,
ps aux | grep nginx | grep-v grep
看起来不错。如果worker\u process为4,则它将有两个主进程。每个nginx实例应该只有一个主进程。停止它,并杀死任何剩余的进程。重新启动它。我已经停止了nginx并终止了进程,但是当我重新启动它时,它也有多个主进程。可能nginx是作为一个/etc/init.d/nginx
启动脚本启动的,也可能是作为一个/etc/init
服务启动的。也许你有一个docker容器也运行nginx