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 ...
随机推荐
- Java B
3.继承时候类的执行顺序问题,一般都是选择题,问你将会打印出什么? 答:父类: package test; public class FatherClass { public FatherClass( ...
- 03CSS内容背景
CSS内容背景 设置背景颜色——background-color 插入背景图片——background-image 设置背景图片位置——background-position 设置重复背景图片—— ...
- 网络共享服务器 samba
之前给自己centos 服务器配置了一下samba网络共享,主要是在windwos上编程,然后方便代码同步到linux上进行编译,现在大概记录一下过程,免得下次又忘记了 首先获取root权限 :su ...
- python爬取百度文库所有内容
转载自 GitHub 的 Jack-Cherish 大神 基本环境配置 版本:python3 系统:Windows 相关模块: import requests import re import jso ...
- windows枚举串口
1. 枚举键值 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM 2. SETUPAPI方式 int EnumPortsWdm() { int i, d ...
- MySQL-Transfer2.2发布
http://dinglin.iteye.com/blog/1888640 Transfer 2.2发布.下载地址 版本说明 1. 基于版本 Percona-5.5.31 ,简单用法是先安装好官方或 ...
- HDU1755
这道题直接暴力枚举复杂度为 n!*m 但是k<100 , 所以我们可以通过取模用dp[i][j] 表示k=i 时,-x取模k为j的最小值 #include <cstdio> #inc ...
- codeforces 361A
//这题看着吓人,为何这么水 #include<stdio.h> int main() { int n,m,i,j; while(scanf("%d%d",& ...
- Linux下汇编语言学习笔记4 ---
这是17年暑假学习Linux汇编语言的笔记记录,参考书目为清华大学出版社 Jeff Duntemann著 梁晓辉译<汇编语言基于Linux环境>的书,喜欢看原版书的同学可以看<Ass ...
- Linux下汇编语言学习笔记1 ---
这是17年暑假学习Linux汇编语言的笔记记录,参考书目为清华大学出版社 Jeff Duntemann著 梁晓辉译<汇编语言基于Linux环境>的书,喜欢看原版书的同学可以看<Ass ...