linux-nginx-closing Process

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.