Disable nginx Process

Source: Internet
Author: User

Disable nginx Process

Of course, it's just a simple introduction to a command.

Nginx creates a working 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;}
fuhui@ubuntu:/usr/local/nginx$ ps -ef | grep 'nginx' root 2713 1 0 07:56 ? 00:00:00 nginx: master process ../sbin/nginxnobody 2747 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2748 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2749 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2750 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2751 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2752 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2753 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2754 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2755 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2756 2713 0 08:00 ? 00:00:00 nginx: worker processfuhui 2852 2332 0 08:29 pts/6 00:00:00 grep --color=auto nginx
Incorrect execution method: fuhui @ ubuntu:/usr/local/nginx $ sudo ps-ef | grep 'nginx' | awk '{kill-9 $2 }'
Correct execution method: fuhui @ ubuntu:/usr/local/nginx $ sudo kill 'ps-ef | grep 'nginx' | awk '{print $2 }''

To kill all Nginx Processes

kill $(ps aux | grep '[n]ginx' | awk '{print $2}')

The effect is the same as that of $ ().

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.