Close Nginx Process

Source: Internet
Author: User

Of course, it's just a matter of introducing an order, so 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

Modify 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:xxNginx:workerProcessNobody2752  2713  0  ,:xx?xx:xx:xxNginx:workerProcessNobody2753  2713  0  ,:xx?xx:xx:xxNginx:workerProcessNobody2754  2713  0  ,:xx?xx:xx:xxNginx:workerProcessNobody2755  2713  0  ,:xx?xx:xx:xxNginx:workerProcessNobody2756  2713  0  ,:xx?xx:xx:xxNginx:workerProcessFuhui2852  2332  0  ,: inpts/6    xx:xx:xxGrep--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

Close Nginx 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.