---
title: "【Nginx六】nginx.conf常用指令(Directive)"
author: "bit1129"
date: "2015-04-24T18:45:17Z"
tags: []
categories: ["开源软件"]
slug: "nginx-nginx-conf-directive"
draft: false
lastmod: "2015-04-24T18:45:17Z"
id: 2205875
url: "https://bit1129.iteye.com/blog/2205875"
---

## 1. worker\_processes    8;

表示Nginx将启动8个工作者进程，通过ps -ef|grep nginx,会发现有8个Nginx Worker Process在运行

 

```
nobody    53879 118449  0 Apr22 ?        00:26:15 nginx: worker process                                          
nobody    53880 118449  0 Apr22 ?        00:27:05 nginx: worker process                                          
nobody    53881 118449  0 Apr22 ?        00:27:31 nginx: worker process                                          
nobody    53882 118449  0 Apr22 ?        00:28:35 nginx: worker process                                          
nobody    53883 118449  0 Apr22 ?        00:28:42 nginx: worker process                                          
nobody    53884 118449  0 Apr22 ?        00:27:48 nginx: worker process                                          
nobody    53885 118449  0 Apr22 ?        00:28:16 nginx: worker process                                          
nobody    53886 118449  1 Apr22 ?        00:29:15 nginx: worker process 
```

 

它们属于PID为118449的子进程，118449表示启动的Nginx进程(Master进程)

 

```
root     118449      1  0  2014 ?        00:00:03 nginx: master process
```

 

## 2. worker\_cpu\_affinity

表示每个工作者进程与哪个CPU进行绑定，