Ale*_*ysh 12 linux ubuntu performance-tuning interrupts high-load
我有一个 Ubuntu VM,在基于 Ubuntu 的 Xen XCP 中运行。它托管基于 FCGI 的自定义 HTTP 服务,位于nginx.
下从负载ab 第一CPU芯饱和,其余为欠载。
在/proc/interrupts我看来,CPU0 提供的中断比任何其他内核都多一个数量级。他们中的大多数来自eth1.
我可以做些什么来提高此 VM 的性能?有没有办法更均衡地平衡中断?
血腥细节:
$ uname -a
Linux MYHOST 2.6.38-15-virtual #59-Ubuntu SMP Fri Apr 27 16:40:18 UTC 2012 i686 i686 i386 GNU/Linux
$ lsb_release -a
没有可用的 LSB 模块。
分销商 ID: Ubuntu
描述:Ubuntu 11.04
发布:11.04
代号:natty
$ cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7
283:113720624 0 0 0 0 0 0 0 xen-dyn-event eth1
284:1 0 0 0 0 0 0 0 xen-dyn-event eth0
285: 2254 0 0 3873799 0 0 0 0 xen-dyn-event blkif
286: 23 0 0 0 0 0 0 0 xen-dyn-event hvc_console
287: 492 42 0 0 0 0 0 295324 xen-dyn-event xenbus
288:0 0 0 0 0 0 0 222294 xen-percpu-ipi callfuncsingle7
289:0 0 0 0 0 0 0 0 xen-percpu-virq debug7
290:0 0 0 0 0 0 0 151302 xen-percpu-ipi callfunc7
291:0 0 0 0 0 0 0 3236015 xen-percpu-ipi resched7
292:0 0 0 0 0 0 0 60064 xen-percpu-ipi spinlock7
293:0 0 0 0 0 0 0 12355510 xen-percpu-virq timer7
294:0 0 0 0 0 0 803174 0 xen-percpu-ipi callfuncsingle6
295:0 0 0 0 0 0 0 0 xen-percpu-virq debug6
296:0 0 0 0 0 0 60027 0 xen-percpu-ipi callfunc6
297:0 0 0 0 0 0 5374762 0 xen-percpu-ipi resched6
298:0 0 0 0 0 0 64976 0 xen-percpu-ipi spinlock6
299:0 0 0 0 0 0 15294870 0 xen-percpu-virq timer6
300:0 0 0 0 0 264441 0 0 xen-percpu-ipi callfuncsingle5
301: 0 0 0 0 0 0 0 0 xen-percpu-virq debug5
302:0 0 0 0 0 79324 0 0 xen-percpu-ipi callfunc5
303:0 0 0 0 0 3468144 0 0 xen-percpu-ipi resched5
304:0 0 0 0 0 66269 0 0 xen-percpu-ipi spinlock5
305:0 0 0 0 0 12778464 0 0 xen-percpu-virq timer5
306:0 0 0 0 844591 0 0 0 xen-percpu-ipi callfuncsingle4
307: 0 0 0 0 0 0 0 0 xen-percpu-virq debug4
308:0 0 0 0 75293 0 0 0 xen-percpu-ipi callfunc4
309:0 0 0 0 3482146 0 0 0 xen-percpu-ipi resched4
310:0 0 0 0 79312 0 0 0 xen-percpu-ipi spinlock4
311:0 0 0 0 21642424 0 0 0 xen-percpu-virq timer4
312:0 0 0 449141 0 0 0 0 xen-percpu-ipi callfuncsingle3
313:0 0 0 0 0 0 0 0 xen-percpu-virq debug3
314:0 0 0 95405 0 0 0 0 xen-percpu-ipi callfunc3
315:0 0 0 3802992 0 0 0 0 xen-percpu-ipi resched3
316:0 0 0 76607 0 0 0 0 xen-percpu-ipi spinlock3
317:0 0 0 16439729 0 0 0 0 xen-percpu-virq timer3
318:0 0 876383 0 0 0 0 0 xen-percpu-ipi callfuncsingle2
319:0 0 0 0 0 0 0 0 xen-percpu-virq debug2
320:0 0 76416 0 0 0 0 0 xen-percpu-ipi callfunc2
321:0 0 3422476 0 0 0 0 0 xen-percpu-ipi resched2
322:0 0 69217 0 0 0 0 0 xen-percpu-ipi spinlock2
323:0 0 10247182 0 0 0 0 0 xen-percpu-virq timer2
324:0 393514 0 0 0 0 0 0 xen-percpu-ipi callfuncsingle1
325:0 0 0 0 0 0 0 0 xen-percpu-virq debug1
326:0 95773 0 0 0 0 0 0 xen-percpu-ipi callfunc1
327:0 3551629 0 0 0 0 0 0 xen-percpu-ipi resched1
328:0 77823 0 0 0 0 0 0 xen-percpu-ipi spinlock1
329:0 13784021 0 0 0 0 0 0 xen-percpu-virq timer1
330:730435 0 0 0 0 0 0 0 xen-percpu-ipi callfuncsingle0
331:0 0 0 0 0 0 0 0 xen-percpu-virq debug0
332:39649 0 0 0 0 0 0 0 xen-percpu-ipi callfunc0
333:3607120 0 0 0 0 0 0 0 xen-percpu-ipi resched0
334:348740 0 0 0 0 0 0 0 xen-percpu-ipi spinlock0
335:89912004 0 0 0 0 0 0 0 xen-percpu-virq timer0
NMI:0 0 0 0 0 0 0 0 不可屏蔽中断
LOC:0 0 0 0 0 0 0 0 本地定时器中断
SPU:0 0 0 0 0 0 0 0 虚假中断
PMI:0 0 0 0 0 0 0 0 性能监控中断
IWI:0 0 0 0 0 0 0 0 IRQ 工作中断
RES:3607120 3551629 3422476 3802992 3482146 3468144 5374762 3236015 重新调度中断
CAL:770084 489287 952799 544546 919884 343765 863201 373596 函数调用中断
TLB:0 0 0 0 0 0 0 0 TLB 击落
TRM:0 0 0 0 0 0 0 0 热事件中断
THR:0 0 0 0 0 0 0 0 阈值 APIC 中断
MCE:0 0 0 0 0 0 0 0 机器检查异常
MCP:0 0 0 0 0 0 0 0 机器检查轮询
错误:0
管理信息:0
chu*_*utz 10
在/proc/irq/283目录中查看。有一个smp_affinity_list文件显示哪些 CPU 将获得 283 中断。对您来说,此文件可能包含“0”(并且smp_affinity可能包含“1”)。
您可以将 CPU 范围写入smp_affinity_list文件:
echo 0-7 | sudo tee /proc/irq/283/smp_affinity_list
Run Code Online (Sandbox Code Playgroud)
或者您可以编写一个位掩码,其中每个位对应一个 CPU,以smp_affinity:
printf %x $((2**8-1)) | sudo tee /proc/irq/283/smp_affinity
Run Code Online (Sandbox Code Playgroud)
然而,已知irqbalance对每个中断应该具有的亲和性有自己的想法,并且它可能会恢复您的更新。所以最好是完全卸载 irqbalance。或者至少停止它并禁用它在重新启动时出现。
如果即使没有 irqbalance,您smp_affinity在重新启动后也会遇到中断 283,您将不得不在您的启动脚本之一中手动更新 CPU 关联。
| 归档时间: |
|
| 查看次数: |
16127 次 |
| 最近记录: |