Of course it's just a matter of introducing an order, it's that simple.
Nginx creates a worker process by default
root 2713 1 0 07:56 ? 00:00:00 nginx: master process ../sbin/nginxnobody 2714 2713 0 07:56 ? 00:00:00 nginx: worker process
Change the worker_processes=10. To create multiple processes
#user nobody;worker_processes 10;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;pid logs/nginx.pid;events { worker_connections 1024;}
[Email protected]:/usr/Local/nginx$ Ps-ef | Grep' Nginx 'Root2713 1 0 -: About?xx:xx:xxNginx:masterProcess.. /sbin/nginxnobody2747 2713 0 ,:xx? xx:xx:xxNginx:workerProcessNobody2748 2713 0 ,:xx?xx:xx:xxNginx:workerProcessNobody2749 2713 0 ,:xx?xx:xx:xxNginx:workerProcessNobody2750 2713 0 ,:xx?xx:xx:xxNginx:workerProcessNobody2751 2713 0 ,:xx?
xx:xx nginx:worker processNobody 275227130 :xx ? xx:xx nginx:worker processNobody 27532713 0 :xx ?
xx:xx nginx:worker processNobody 275427130 :xx ?
xx:xx nginx:worker processNobody 27552713 0 :xx ?
00 : 00 : 00 nginx:worker process nobody 2756 2713 0 08 : 00 ? 00 : 00 : 00 Nginx:worker process fuhui 2852 2332 0 08 : 29 pts/6 00 : 00 : 00 grep --color=auto nginx
错误的运行方式fuhui@ubuntu:/usr/local/nginx$ ‘nginx‘‘{kill -9 $2}‘
正确的运行方式fuhui@ubuntu:/usr/local/nginx$ ‘nginx‘‘{print $2}‘ `
To kill all Nginx Processes
kill $(ps aux | grep ‘[n]ginx‘ | awk ‘{print $2}‘)
Use "with $ () effect is the same
linux-nginx-closing Process