完成后,重启服务器
重启后,登录到系统中
察看中断分配情况
cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
0: 27 0 0 0 IO-APIC-edge timer
1: 0 1 1 0 IO-APIC-edge i8042
6: 0 1 0 1 IO-APIC-edge floppy
9: 0 0 0 0 IO-APIC-fasteoi acpi
12: 1 0 1 2 IO-APIC-edge i8042
14: 0 0 0 0 IO-APIC-edge ide0
15: 0 0 0 0 IO-APIC-edge ide1
17: 0 0 0 0 IO-APIC-fasteoi uhci_hcd:usb3, ehci_hcd:usb7
18: 0 0 0 0 IO-APIC-fasteoi uhci_hcd:usb1, uhci_hcd:usb6
19: 0 0 0 0 IO-APIC-fasteoi uhci_hcd:usb5
21: 0 0 0 0 IO-APIC-fasteoi uhci_hcd:usb2
23: 0 0 0 0 IO-APIC-fasteoi uhci_hcd:usb4, ehci_hcd:usb8
379: 180564744 180564148 6 4 PCI-MSI-edge eth1
380: 5 3 181325020 181321112 PCI-MSI-edge eth0
381: 528 539 188 188 PCI-MSI-edge ahci
NMI: 0 0 0 0 Non-maskable interrupts
LOC: 2098128 2098112 2098094 2098076 Local timer interrupts
RES: 1235 1318 1707 2126 Rescheduling interrupts
CAL: 1418 1424 1423 10 Function call interrupts
TLB: 260 245 639 597 TLB shootdowns
TRM: 0 0 0 0 Thermal event interrupts
SPU: 0 0 0 0 Spurious interrupts
ERR: 0
MIS: 0
找当中与网卡有关的中断,上面的表中,中断379对应eth1,中断380对应eth0
进入对应的中断控制目录,指定cpu0 和cpu1负责eth1的中断处理
cd /proc/irq/379
echo 3 >smp_affinity
指定cpu2和cpu3负责eth0的中断处理
cd /proc/irq/380
echo c >smp_affinity
这样,指定cpu响应不同网卡的请求,提高系统处理能力(上面的表中能明显看出网卡的中断是分配在不同的cpu上的)
补充:
修改tcp_timeout_established的参数,在文件 net/netfilter/nf_conntrack_proto_tcp.c 中
修改buckets和ip_conntrack_max的参数,在文件 net/netfilter/nf_conntrack_core.c 里面
需要修改参数请在编译前修改
不明白请参考我原来写的文章,见下一页