Nginx high-performance Server installation, configuration, and O & M (4)-nginx service, architecture, and signal details

Source: Internet
Author: User
Iv. nginx service, architecture and Signal

 

(1) view nginx services

1.Netstat-antpCheck whether nginx is running on port 80:

 

2. View nginx processes in PS aux | grep nginx:

 

It is found that nginx has enabled two or more processes, one master process and one or more worker processes ).

From this we can see that nginx has a master process file for management and impact (such as disabling) 4 ~ 8 sub-processes. browser requests are handled by sub-processes.

 

The nginx worker model is as follows:

 

The main process is responsible for executing the following tasks:

  • Read and verify configurations
  • Create, bind, and close a socket
  • Start, terminate, and maintain the number of work processes in the configuration
  • Online Reconfiguration
  • Online upgrade
  • Re-open the log file
  • Compile embedded Perl scripts

 

The worker process accepts and processes connections from clients, provides reverse proxy and filtering functions, and almost all other tasks that nginx can accomplish.

To monitor an nginx interface, the system administrator should monitor the worker because it reflects the daily operations of the Web server.

 

(2) nginx Signal Control

Nginx uses signals to control nginx stop and smooth restart. The main semaphores include:

 

Term, int

Quick Shutdown

Quit

Graceful shutdown: closes the process after the request ends.

Hup

Configuration reload, start the new worker processes

A new configuration gracefully shutdown the old worker Processes

Change the configuration file, repeat the configuration file smoothly, and restart

Usr1

Reopen the log files to repeat the log, which is useful in log Segmentation

Usr2

Upgrade executable on the Fly smooth upgrade

Winch

Gracefully shutdown the worker processes calmly shut down the old process (with usr2 for upgrade)

 

Example of signal usage:

 

The nginx process is disabled by using the int signal (kill-int process number ).

 

(This article was edited by Kayvan, the content is mainly collected on the internet, please indicate the source: http://www.cnblogs.com/kayvan)

 

Nginx high-performance Server installation, configuration, and O & M (4)-nginx service, architecture, and signal details

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.