当前位置: > Linux服务器 > nginx >

Nginx优化worker_processes(worker_cpu_affinity)

时间:2016-04-11 22:01来源:linux.it.net.cn 作者:IT
Nginx 优化:CPU(Core) + worker_processes(worker_cpu_affinity)
下面总结了,四线程、八线程、十六线程的CPU查看与Nginx进行配置内容:
配置1:4 CPU(4 Core) + 4 worker_processes(每个worker_processes 使用1个CPU)

[it@it.net.cn ~]$ cat /proc/cpuinfo | grep processor

processor : 0

processor : 1

processor : 2

processor : 3

worker_processes 4;

worker_cpu_affinity 0001 0010 0100 1000;

配置2:8 CPU(8 Core) + 8 worker_processes(每个worker_processes 使用1个CPU)

[it@it.net.cn ~]$ cat /proc/cpuinfo | grep processor

processor : 0

processor : 1

processor : 2

processor : 3

processor : 4

processor : 5

processor : 6

processor : 7

worker_processes 8;

worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;

配置3:16 CPU(16 Core) + 16 worker_processes(每个worker_processes 使用1个CPU)

[it@it.net.cn ~]$ cat /proc/cpuinfo | grep processor

processor : 0

processor : 1

processor : 2

processor : 3

processor : 4

processor : 5

processor : 6

processor : 7

processor : 8

processor : 9

processor : 10

processor : 11

processor : 12

processor : 13

processor : 14

processor : 15

worker_processes 16;

worker_cpu_affinity 0000000000000001 0000000000000010 0000000000000100 0000000000001000 0000000000010000 0000000000100000 0000000001000000 0000000010000000 0000000100000000 0000001000000000 0000010000000000 0000100000000000 0001000000000000 0010000000000000 0100000000000000 1000000000000000;
(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容