CentOS系统中的irqbalance配置与自定

简介
在CentOS系统中,irqbalance是一个用于平衡中断请求(IRQ)分配的程序,它可以帮助系统管理员在多核处理器上优化中断处理,从而提高系统的性能和稳定性,通过合理配置irqbalance,可以确保每个CPU核心均匀地处理中断,避免某些核心负载过重,而其他核心空闲。
irqbalance的工作原理

irqbalance通过以下步骤实现中断请求的平衡:
- 识别系统中所有可用的CPU核心。
- 收集每个中断的统计信息,包括中断次数、处理时间等。
- 根据统计信息,为每个中断分配一个最合适的CPU核心。
- 动态调整中断分配,以适应系统负载的变化。
CentOS中irqbalance的默认配置
在CentOS系统中,irqbalance通常已经默认安装并启用,以下是一个典型的irqbalance配置文件(/etc/sysconfig/irqbalance)的内容:

# IRQBALANCE
# This file controls the operation of the irqbalance daemon.
# It is used by the irqbalance package.
# Enable or disable the irqbalance service
ENABLED=yes
# The number of cpus to use for balancing
CPU_MASK="0x1F"
# The maximum number of irqs to balance at once
MAX_IRQS=256
# The maximum time to wait for an irq to become available
MAX_WAIT=100
# The time to wait before balancing irqs
BALANCE_INTERVAL=60
# The time to wait before rebalancing irqs
REBALANCE_INTERVAL=60
# The time to wait before rebalancing irqs after a cpu is added or removed
REBALANCE_DELAY=60
# The time to wait before starting the rebalancing process
STARTUP_DELAY=60
# The time to wait before exiting the rebalancing process
EXIT_DELAY=60
# The number of irqs to balance per cpu
IRQS_PER_CPU=16
# The number of irqs to ignore
IGNORED_IRQS="0"
# The number of irqs to balance
BALANCED_IRQS="0"
# The maximum number of times to try to balance an irq
MAX_TRIES=5
# The time to wait before trying to balance an irq again
TRY_INTERVAL=5
# The time to wait before exiting the service
EXIT_INTERVAL=5
# The time to wait before checking the system load
LOAD_CHECK_INTERVAL=5
# The time to wait before checking the cpu load
CPU_LOAD_CHECK_INTERVAL=5
# The time to wait before checking the cpu load
CPU_LOAD_INTERVAL=5
# The time to wait before checking the cpu load
CPU_LOAD_THRESHOLD=0.5
# The time to wait before checking the cpu load
CPU_LOAD_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MIN_INTERVAL=5
# The time to wait before checking the cpu load
CPU_LOAD_MIN_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_INTERVAL=5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before checking the cpu load
CPU_LOAD_MAX_FACTOR=0.5
# The time to wait before 
