当网卡设置irq亲和力时,boost :: asio :: io_service性能下降

时间:2015-11-15 10:06:30

标签: linux boost boost-asio cpu

我一直在测试pbrpc框架(sofa-pbrpc)的性能(qps)。

当我使用cpu0处理软件中断时,qps为100w +。

  

top命令

top - 18:00:54 up 158 days, 18 min,  3 users,  load average: 18.09, 19.29, 18.74
Tasks: 793 total,   3 running, 790 sleeping,   0 stopped,   0 zombie
Cpu0  :  0.0% us,  0.0% sy,  0.0% ni,  0.0% id,  0.0% wa,  0.0% hi, 100.0% si
Cpu1  : 58.7% us, 11.6% sy,  0.7% ni, 28.4% id,  0.7% wa,  0.0% hi,  0.0% si
Cpu2  : 68.0% us, 11.6% sy,  0.0% ni, 19.8% id,  0.7% wa,  0.0% hi,  0.0% si
Cpu3  : 52.3% us,  8.3% sy,  0.0% ni, 39.1% id,  0.3% wa,  0.0% hi,  0.0% si
Cpu4  : 73.5% us, 11.9% sy,  0.0% ni, 13.9% id,  0.7% wa,  0.0% hi,  0.0% si
Cpu5  : 52.5% us, 10.2% sy,  0.3% ni, 36.6% id,  0.3% wa,  0.0% hi,  0.0% si
Cpu6  : 72.4% us, 13.2% sy,  0.0% ni, 13.2% id,  1.3% wa,  0.0% hi,  0.0% si
Cpu7  : 74.7% us, 11.8% sy,  0.0% ni, 12.5% id,  1.0% wa,  0.0% hi,  0.0% si
Cpu8  : 72.5% us, 12.8% sy,  0.0% ni, 14.1% id,  0.7% wa,  0.0% hi,  0.0% si
Cpu9  : 82.9% us, 13.5% sy,  0.0% ni,  3.0% id,  0.7% wa,  0.0% hi,  0.0% si
Cpu10 : 82.1% us, 14.6% sy,  0.0% ni,  3.0% id,  0.3% wa,  0.0% hi,  0.0% si
Cpu11 : 85.9% us, 13.2% sy,  0.0% ni,  0.7% id,  0.3% wa,  0.0% hi,  0.0% si
Cpu12 : 84.2% us, 14.5% sy,  0.0% ni,  0.0% id,  1.3% wa,  0.0% hi,  0.0% si
Cpu13 : 67.4% us, 12.2% sy,  0.0% ni, 19.7% id,  0.7% wa,  0.0% hi,  0.0% si
Cpu14 : 72.6% us, 13.5% sy,  0.0% ni, 13.2% id,  0.7% wa,  0.0% hi,  0.0% si
Cpu15 : 77.4% us, 12.8% sy,  0.0% ni,  8.9% id,  1.0% wa,  0.0% hi,  0.0% si
Cpu16 : 84.5% us, 14.5% sy,  0.0% ni,  0.3% id,  0.7% wa,  0.0% hi,  0.0% si
Cpu17 : 84.1% us, 14.2% sy,  0.0% ni,  1.0% id,  0.7% wa,  0.0% hi,  0.0% si
Cpu18 : 84.1% us, 13.6% sy,  0.0% ni,  2.0% id,  0.3% wa,  0.0% hi,  0.0% si
Cpu19 : 83.2% us, 14.2% sy,  0.0% ni,  1.7% id,  1.0% wa,  0.0% hi,  0.0% si
Cpu20 : 28.7% us,  4.3% sy,  0.0% ni, 63.7% id,  3.3% wa,  0.0% hi,  0.0% si
Cpu21 : 83.2% us, 13.9% sy,  0.0% ni,  2.3% id,  0.7% wa,  0.0% hi,  0.0% si
Cpu22 :  1.0% us,  2.3% sy,  0.3% ni, 96.4% id,  0.0% wa,  0.0% hi,  0.0% si
Cpu23 :  0.3% us,  0.3% sy,  0.3% ni, 99.0% id,  0.0% wa,  0.0% hi,  0.0% si
Cpu24 : 84.8% us, 13.2% sy,  0.0% ni,  1.0% id,  1.0% wa,  0.0% hi,  0.0% si
Cpu25 : 84.8% us, 14.6% sy,  0.0% ni,  0.0% id,  0.7% wa,  0.0% hi,  0.0% si
Cpu26 : 84.8% us, 14.5% sy,  0.0% ni,  0.0% id,  0.7% wa,  0.0% hi,  0.0% si
Cpu27 : 83.4% us, 14.9% sy,  0.0% ni,  0.7% id,  1.0% wa,  0.0% hi,  0.0% si
Cpu28 : 83.9% us, 14.8% sy,  0.0% ni,  0.3% id,  1.0% wa,  0.0% hi,  0.0% si
Cpu29 : 23.1% us,  3.6% sy,  0.0% ni, 72.9% id,  0.3% wa,  0.0% hi,  0.0% si
Cpu30 :  2.0% us,  0.7% sy,  0.3% ni, 97.0% id,  0.0% wa,  0.0% hi,  0.0% si
Cpu31 :  3.9% us,  1.3% sy,  0.0% ni, 94.7% id,  0.0% wa,  0.0% hi,  0.0% si
Mem:  132133912k total,  4835356k used, 127298556k free,   153412k buffers

然而,使用set_irq_affinity.sh,qps降级为70w +。

  

top命令

top - 18:05:38 up 158 days, 22 min,  3 users,  load average: 13.13, 18.03, 18.51
Tasks: 801 total,   2 running, 798 sleeping,   1 stopped,   0 zombie
Cpu0  : 62.2% us, 13.2% sy,  0.0% ni,  4.6% id,  0.7% wa,  0.0% hi, 19.4% si
Cpu1  : 55.8% us, 10.9% sy,  0.3% ni, 15.5% id,  0.0% wa,  0.0% hi, 17.5% si
Cpu2  : 59.5% us, 12.5% sy,  0.0% ni, 12.8% id,  0.3% wa,  0.0% hi, 14.8% si
Cpu3  : 33.7% us,  9.6% sy,  0.0% ni, 47.9% id,  0.3% wa,  0.0% hi,  8.6% si
Cpu4  : 59.1% us, 12.2% sy,  0.0% ni, 11.2% id,  0.7% wa,  0.0% hi, 16.8% si
Cpu5  : 51.0% us, 10.5% sy,  0.0% ni, 27.0% id,  0.3% wa,  0.0% hi, 11.2% si
Cpu6  : 66.9% us, 12.8% sy,  0.0% ni,  3.6% id,  0.7% wa,  0.0% hi, 16.1% si
Cpu7  : 64.8% us, 12.8% sy,  0.0% ni,  3.0% id,  0.3% wa,  0.0% hi, 19.1% si
Cpu8  : 48.0% us,  9.2% sy,  0.3% ni, 32.2% id,  0.3% wa,  0.0% hi,  9.9% si
Cpu9  : 50.0% us, 10.3% sy,  0.0% ni, 25.2% id,  0.3% wa,  0.0% hi, 14.2% si
Cpu10 : 63.0% us, 11.9% sy,  0.0% ni,  7.9% id,  0.3% wa,  0.0% hi, 16.8% si
Cpu11 : 60.9% us, 12.8% sy,  0.0% ni,  8.9% id,  0.3% wa,  0.0% hi, 17.1% si
Cpu12 : 62.6% us, 12.6% sy,  0.0% ni,  3.6% id,  0.3% wa,  0.0% hi, 20.9% si
Cpu13 : 56.2% us, 11.8% sy,  0.0% ni, 19.1% id,  0.3% wa,  0.0% hi, 12.5% si
Cpu14 : 64.0% us, 13.2% sy,  0.0% ni,  6.9% id,  0.3% wa,  0.0% hi, 15.5% si
Cpu15 : 65.0% us, 14.5% sy,  0.0% ni,  3.3% id,  0.7% wa,  0.0% hi, 16.5% si
Cpu16 : 65.8% us, 12.5% sy,  0.0% ni,  1.6% id,  0.3% wa,  0.0% hi, 19.7% si
Cpu17 : 63.2% us, 12.9% sy,  0.0% ni,  2.6% id,  0.3% wa,  0.0% hi, 20.9% si
Cpu18 : 15.2% us,  4.0% sy,  0.0% ni, 77.6% id,  0.0% wa,  0.0% hi,  3.3% si
Cpu19 : 58.4% us, 12.2% sy,  0.0% ni, 12.9% id,  0.3% wa,  0.0% hi, 16.2% si
Cpu20 : 48.8% us, 10.2% sy,  0.0% ni, 27.4% id,  0.3% wa,  0.0% hi, 13.2% si
Cpu21 : 31.6% us,  5.9% sy,  0.0% ni, 54.3% id,  0.3% wa,  0.0% hi,  7.9% si
Cpu22 :  0.7% us,  1.3% sy,  0.0% ni, 98.0% id,  0.0% wa,  0.0% hi,  0.0% si
Cpu23 : 64.8% us, 12.8% sy,  0.0% ni,  1.6% id,  0.7% wa,  0.0% hi, 20.1% si
Cpu24 : 64.8% us, 12.2% sy,  0.0% ni,  5.3% id,  0.7% wa,  0.0% hi, 17.1% si
Cpu25 : 59.5% us, 14.1% sy,  0.0% ni,  8.9% id,  0.3% wa,  0.0% hi, 17.1% si
Cpu26 : 63.7% us, 13.5% sy,  0.0% ni,  3.0% id,  0.0% wa,  0.0% hi, 19.8% si
Cpu27 : 60.7% us, 12.2% sy,  0.0% ni,  9.2% id,  0.3% wa,  0.0% hi, 17.5% si
Cpu28 : 62.2% us, 13.5% sy,  0.0% ni,  1.3% id,  0.3% wa,  0.0% hi, 22.7% si
Cpu29 : 12.5% us,  4.6% sy,  0.3% ni, 79.2% id,  0.0% wa,  0.0% hi,  3.3% si
Cpu30 :  2.3% us,  2.0% sy,  1.3% ni, 94.1% id,  0.0% wa,  0.0% hi,  0.3% si
Cpu31 :  3.3% us,  1.7% sy,  0.0% ni, 94.7% id,  0.0% wa,  0.0% hi,  0.3% si
Mem:  132133912k total,  4888040k used, 127245872k free,   153440k buffers

在boost asio中是否有一些特殊处理?

0 个答案:

没有答案