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进行绑定,