原文地址:http://nginx.com/resources/admin-guide/processes-and-runtime-control/

Processes and Runtime Control

进程和实时控制

This section describes the processes NGINX starts at run time and how to control them.

本文讨论Nginx開始执行时的进程以及怎样控制这些进程。

Master and Worker Processes

主进程和工作进程

NGINX has one master process and one or more worker processes. If caching is enabled, the cache loader and cache manager processes
will also run.

Nginx 有一个主进程和至少一个工作进程。假设缓存开启,缓存载入器和缓存管理器进程也会执行。

The main purpose of the master process is to read and evaluate configuration files, as well as, maintaining worker processes.

主进程的主要工作就是读取和评估配置文件,同一时候操作工作进程。

The Worker processes do the actual processing of requests. NGINX relies on OS-dependent mechanisms to efficiently distribute requests among worker processes. The number of worker processes is defined in the nginx.conf file and may be fixed for
a given configuration or automatically adjusted to the number of available CPU cores (see worker_processes).

工作进程直接处理请求。Nginx依赖操作系统机制均衡地把请求分发到各工作进程。工作进程和数量在nginx.conf文件里定义,当然也能够设置为自己主动来依据可用的CPU内核进程调整(见worker_processes)。

Controlling nginx

控制Nginx

To reload your configuration, you can stop, or restart nginx, or send signals to the master process. A signal can be sent by running the NGINX executable with the -s parameter.

要重加载入你的配置。你能够停止,或者重新启动Nginx。或者发送一个信号给主进程。执行nginx并带着-s參数能发送一个信号给Nginx主进程。

nginx -s signal

When us -s the signal parameter may be one of the following:

-s 后接的信号參数为下面当中一个:

  • stop — fast shutdown  高速关闭
  • quit — graceful shutdown  优雅关闭
  • reopen — reopening the log files  重新启动日志文件
  • reload — reloading the configuration file  重载入配置文件

A signal can also be sent directly to the master process with the use of the kill utility. The process ID of the master process is written, by default, to the nginx.pid file, which is located in the /usr/local/nginx/logs or /var/run directory.

一个信号也可能直接使用kill工具发送给主进程。须要用到主进程的进程号,默认的在nginx.pid文件里,该文件可能放在/usr/local/nginx/logs或者/var/run文件夹下。

You can read more about advanced signals like log file reopening and live binary upgrades in the Controlling NGINX documentation.

你能够在 Controlling NGINX documentation 里找到很多其它的可用信号,比如重新启动日志文件和执行时二进制升级。

最新文章

  1. 高性能IO模型浅析
  2. SDK接入(2)之Android Google Play内支付(in-app Billing)接入
  3. PAT Basic Level 1001
  4. MIME列表
  5. Yii学习
  6. MySQL的外键是什么和它的作用
  7. 000 VS2013 c++ 框架
  8. php跨服务器信息获取之cURL
  9. nodejs and db
  10. angular json转义html
  11. 使用Fiddler抓取手机上的数据包
  12. WebSite---前台系统图片验证码心得
  13. c# 岛2 小辅助~~~ 钓鱼 连击
  14. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习5
  15. redist命令操作(三)--集合Set,有序集合ZSet
  16. 开源项目filepond的独立自由之路:城市套路深
  17. MacOs brew 命令行安装常见工具
  18. MySql 主辅-一主多辅
  19. R语言编程艺术#02#矩阵(matrix)和数组(array)
  20. Python3基础 str find+index 是否存在指定字符串,有则返回第一个索引值

热门文章

  1. CAD参数绘制多行文字(网页版)
  2. vue解决IOS10低版本白屏问题
  3. No-2.注释
  4. python circle nested
  5. js 技巧 (六)弹窗代码汇总
  6. leetcode-169求众数
  7. Quartz--01
  8. Spring Boot 2 (二):Spring Boot 2 尝鲜-动态 Banner
  9. dsu+树链剖分+树分治
  10. HDU 5025 状态压缩蛇+bfs+dp