nginx进程和实时控制
原文地址: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 里找到很多其它的可用信号,比如重新启动日志文件和执行时二进制升级。
nginx进程和实时控制的更多相关文章
- Nginx-->基础-->理论-->002:Nginx进程介绍
一.Nginx进程介绍
- Nginx-->基础-->理论-->nginx进程模型
一.nginx的进程模型基础 如上图,是nginx的基本进程模型. 1.nginx的master进程与worker进程关系 nginx的master进程负责worker进程的管理,包括创建worker ...
- Nginx学习笔记(八) Nginx进程启动分析
Nginx进程启动分析 worker子进程的执行循环的函数是ngx_worker_process_cycle (src/os/unix/ngx_process_cycle.c). 其中,捕获事件.分发 ...
- 【学习笔记】启动Nginx、查看nginx进程、查看nginx服务主进程的方式、Nginx服务可接受的信号、nginx帮助命令、Nginx平滑重启、Nginx服务器的升级
1.启动nginx的方式: cd /usr/local/nginx ls ./nginx -c nginx.conf 2.查看nginx的进程方式: [root@localhost nginx] ...
- 转载:2.1 运行中的Nginx进程间的关系《深入理解Nginx》(陶辉)
原文:https://book.2cto.com/201304/19624.html 在正式提供服务的产品环境下,部署Nginx时都是使用一个master进程来管理多个worker进程,一般情况下,w ...
- nginx——绑定 Nginx 进程到不同的 CPU 上
为什么要绑定 Nginx 进程到不同的 CPU 上 :默认情况下,Nginx 的多个进程有可能跑在某一个 CPU 或 CPU 的某一核上,导致 Nginx 进程使用硬件的资源不均,因此绑定 Nginx ...
- 使用nagios+python监控nginx进程数
1.编写python脚本监控nginx #!/usr/bin/python # -*- coding: utf-8 -*- import os, sys, time import string imp ...
- 设置NGINX进程分配至多核CPU提升性能
Nginx 配置文件 nginx.conf 首先需要找到 Nginx 的配置文件 nginx.conf 才能进行下面的操作,在LNMP一键安装包默认配置下,nginx.conf 存放在/usr/loc ...
- 统计nginx进程占用的物理内存
#!/usr/bin/env python #-*- coding:utf-8 -*- ''' 统计nginx进程占用的物理内存 ''' import os import sys import sub ...
随机推荐
- css 动态导入css文件 @import 动态js加载 都是静态的
@import "http://apps.bdimg.com/libs/bootstrap/3.3.4/css/bootstrap.css" /*-防止各大cdn公共库加载地址失效 ...
- Danfoss Motor - Automotive Motor: What Sensors Are There?
The Danfoss Motor states that the motor sensor control system is the heart of the entire autom ...
- Unexpected token d in JSON at position 669 while parsing near '...ct-mode":"^6.0.2"}
问题 在安装 babel 的时候,遇到问题 Unexpected token d in JSON at position 669 while parsing near '...ct-mode" ...
- BZOJ 2055 80人环游世界 有上下界最小费用可行流
题意: 现在有这么一个m人的团伙,也想来一次环游世界. 他们打算兵分多路,游遍每一个国家. 因为他们主要分布在东方,所以他们只朝西方进军.设从东方到西方的每一个国家的编号依次为1...N.假若第 ...
- Dash Speed
题目大意: 比特山是比特镇的飙车圣地.在比特山上一共有n 个广场,编号依次为1 到n,这些广场之间通过n - 1 条双向车道直接或间接地连接在一起,形成了一棵树的结构.因为每条车道的修建时间以及建筑材 ...
- linux中PHP安装扩展包(mongodb为例)
相对于windows中的PHP扩展,只需要在下载相应的dll资源,并且添加配置在php.ini之后即可. 但是在linux安装扩展时,需要进行编译安装. 这里以lnmp一键安装包为例(php.ini位 ...
- 合并多个MP4文件
把多个MP4文件连接起来的方法与音频文件不太一样,比较有效的方法是: $ cat mylist.txt file '/path/to/file1' file '/path/to/file2' file ...
- 自己封装的js工具
// 封装函数insertAfter;功能类似insertBefore(); var div = document.getElementsByTagName("div")[0]; ...
- Linux最常用的基础命令 上篇
Linux最常用的基础命令个人总结 计算机基础知识 32bit和64bit系统的区别.系统运行机制 1989年python 诞生 C语言是编译型的语言,不太支持跨平台 Django 江购 32bit= ...
- 九度oj 题目1205:N阶楼梯上楼问题
题目1205:N阶楼梯上楼问题 时间限制:1 秒 内存限制:128 兆 特殊判题:否 提交:4990 解决:2039 题目描述: N阶楼梯上楼问题:一次可以走两阶或一阶,问有多少种上楼方式.(要求采用 ...