NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
70599
V2EX  ›  NGINX

单核 CPU x2 的 worker_cpu_affinity 该怎么写?

  •  
  •   70599 · Jul 5, 2015 · 3746 views
    This topic created in 4008 days ago, the information mentioned may be changed or developed.
    网上一搜一大堆各种一个多核CPU的写法,找不到双CPU的模版。
    5 replies    2015-07-06 23:13:33 +08:00
    ryd994
        2
    ryd994  
       Jul 5, 2015 via Android
    cat /proc/cpuinfo
    慢慢看
    msg7086
        3
    msg7086  
       Jul 6, 2015
    4核
    worker_processes 4;
    worker_cpu_affinity 0001 0010 0100 1000;

    2核
    worker_processes 2;
    worker_cpu_affinity 01 10;

    别说你举一反三都不行。
    70599
        4
    70599  
    OP
       Jul 6, 2015
    @msg7086 这是针对一个cpu的配置是吧?我下面这样的cpuinfo看起来像有两个单核逻辑cpu,我看对了吗?
    cat /proc/cpuinfo
    processor : 0
    vendor_id : GenuineIntel
    cpu family : 6
    model : 45
    model name : Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz
    stepping : 7
    microcode : 1805
    cpu MHz : 1795.673
    cache size : 20480 KB
    physical id : 2
    siblings : 1
    core id : 0
    cpu cores : 1
    apicid : 2
    initial apicid : 2
    fpu : yes
    fpu_exception : yes
    cpuid level : 13
    wp : yes
    flags : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm rep_good unfair_spinlock pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes hypervisor lahf_lm arat epb xsaveopt pln pts dts
    bogomips : 3591.34
    clflush size : 64
    cache_alignment : 64
    address sizes : 46 bits physical, 48 bits virtual
    power management:

    processor : 1
    vendor_id : GenuineIntel
    cpu family : 6
    model : 45
    model name : Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz
    stepping : 7
    microcode : 1805
    cpu MHz : 1795.673
    cache size : 20480 KB
    physical id : 2
    siblings : 1
    core id : 0
    cpu cores : 1
    apicid : 2
    initial apicid : 2
    fpu : yes
    fpu_exception : yes
    cpuid level : 13
    wp : yes
    flags : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm rep_good unfair_spinlock pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes hypervisor lahf_lm arat epb xsaveopt pln pts dts
    bogomips : 3591.34
    clflush size : 64
    cache_alignment : 64
    address sizes : 46 bits physical, 48 bits virtual
    power management:

    按照双核CPU的配置来?
    msg7086
        5
    msg7086  
       Jul 6, 2015
    $ grep vendor /proc/cpuinfo | wc -l
    2

    当然按照双核来。
    (其实是按照线程数,比如i7 4c8t就用8线程比较好。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1672 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 120ms · UTC 16:21 · PVG 00:21 · LAX 09:21 · JFK 12:21
    ♥ Do have faith in what you're doing.