Chinaunix首页 | 论坛 | 博客
  • 博客访问: 421453
  • 博文数量: 125
  • 博客积分: 2838
  • 博客等级: 少校
  • 技术积分: 1410
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-05 09:45
文章分类

全部博文(125)

文章存档

2012年(13)

2011年(5)

2010年(107)

我的朋友

分类: LINUX

2010-08-05 18:03:25

 
1.irqbalance
......之前由于精简系统的服务而没有开启irqbalance服务,但是irqbalance现在被证实为非常有必要的服务,他的主要功能是可以合理的调配使用各个CPU核心,特别是对于目前主流多核心的CPU,简单的说就是能够把压力均匀的分配到各个CPU核心上,对提升性能有很大的帮助,引用一段话:
 
启用 irqbalance 服务,既可以提升性能,又可以降低能耗。
irqbalance 用于优化中断分配,它会自动收集系统数据以分析使用模式,并依据系统负载状况将工作状态置于 Performance mode 或 Power-save mode。
处于 Performance mode 时,irqbalance 会将中断尽可能均匀地分发给各个 CPU core,以充分利用 CPU 多核,提升性能。
处于 Power-save mode 时,irqbalance 会将中断集中分配给第一个 CPU,以保证其它空闲 CPU 的睡眠时间,降低能耗。
(详见:http://www.irqbalance.org/documentation.php)
 
开启irqbalance服务,具体操作如下:

shell> chkconfig –level 2345 irqbalance on
shell> service irqbalance start
 
如果没有此服务,请先安装依赖软件包,操作如下:

shell> yum -y install irqbalance
shell> service irqbalance start
 
可以使用shell>mpstat -P ALL 1 10来观察前后的实际的CPU使用运行情况。

1.检查操作系统中运行的时候各个设备IO是否已经启用了irqbalance(其应用就
是设备负载均衡调度)?这个命令可以看到
# cat /proc/interrupts
输出结果类似下面的信息:
          CPU0       CPU1       CPU2       CPU3      
  0:  441733344  441704798  441804679  441725019    IO-APIC-edge  timer
  1:          0          1          2          0    IO-APIC-edge  i8042
  8:          1          0          1          1    IO-APIC-edge  rtc
  9:          0          0          0          0   IO-APIC-level  acpi
12:          1          1          2          0    IO-APIC-edge  i8042
14:    3962749    3990999    3891110    3970770    IO-APIC-edge  ide0
98:          0          0          0          0   IO-APIC-level  uhci_hcd:usb4
106:         22         23         26         27   IO-APIC-level  uhci_hcd:usb5
130:    7786510          0          0          0       PCI-MSI-X  cciss0
146:    6652580          0          0          0         PCI-MSI  eth0
154:    1257030          0          0          0         PCI-MSI  eth1
169:          0          0          2          0   IO-APIC-level  uhci_hcd:usb1, ehci_hcd:usb6
177:          0          0          0          0   IO-APIC-level  uhci_hcd:usb2
185:         13         10         10         15   IO-APIC-level  uhci_hcd:usb3
NMI:          0          0          0          0
LOC: 1766973093 1766973092 1766973170 1766973169
从上面的输出内容可以看出,网卡1(eth0)和网卡2(eth1)的IO并没有工作在负载均衡调度
模式下面,所有的数据传输都加到CPU的了第一个核里面去了,而其它核则处于空闲状态(显然
这是一种系统资源的浪费形象)。当然了,并不是所有的硬件设备都完全支持irqbalance。不过
我们可以通过修改启动参数尝试让硬件设备都工作在irqbalance模式下面,从而提高系统资源的
利用效率,降低由于系统资源使用不充分造成系统响应缓慢,某些资源负载过高而某些资源
却闲着“没事干”的情况发生。
2.至于cpuspeed,如果你不想你的本太热,可以开启这个东西。至于为什么,下面有相关解释:
The cpuspeed daemon can be useful for laptops. This daemon lowers the processor clock speed during idle periods to
help conserve battery power. Various options can be set to adjust the criteria used by cpuspeed to decide when to alter
the clock speed. Permanent options can be specified in /etc/sysconfig/cpuspeed.
 
阅读(2148) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~