Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:services:irqbalance [2021/09/10 06:02] – [Installation] darksky2docs:guide-user:services:irqbalance [2024/01/02 18:48] – [Installation] mention new luci package palebloodsky
Line 1: Line 1:
 ====== Irqbalance ====== ====== Irqbalance ======
  
-Irqbalance is a Linux daemon that distributes interrupts over multiple logical CPUs. This design intent being to improve overall performance which can result in a balanced load and power consumption.+Irqbalance is a Linux daemon that distributes interrupts over multiple logical CPUs. This may result in improved overall performance and even reduced power consumption.
  
 ==== Installation ==== ==== Installation ====
Line 8: Line 8:
 <code bash>opkg update && opkg install irqbalance</code> <code bash>opkg update && opkg install irqbalance</code>
  
-It will not be enabled by default. To enable thisedit configuration file with the editor of your choice:+Note if you run a build from main snapshot you can also install the new ''luci-app-irqbalance''
 + 
 +It will not be enabled by default. Set the following enable line to 1save and close:
 <code bash>nano /etc/config/irqbalance</code> <code bash>nano /etc/config/irqbalance</code>
-Set the enable line to 1, save and close. 
  
 Now start the daemon: Now start the daemon:
Line 19: Line 20:
 ==== Advanced Usage ==== ==== Advanced Usage ====
  
-In general, these items are not necessary for irqbalance to function well, however they are provided as an exploration to test various affinity and interrupt options.+In general, the items below are not necessary for irqbalance to function, however they are used for affinityinterrupt options, and status checks.
  
-To check the status of irqbalance running simply use service:+To check the status of irqbalance simply use service:
 <code bash>service irqbalance</code> <code bash>service irqbalance</code>
  
-To set an IRQ to run on only one CPU, use echo to write the CPU mask, as a hexadecimal number, to the smp_affinity entry of the specific IRQ. In this example, we are instructing the interrupt with IRQ number 142 to run on CPU0 only:+To set an IRQ to run on a specific CPU core, use echo to write the CPU mask, as a hexadecimal number, to the smp_affinity entry of the IRQ. In this example, we are instructing the interrupt with IRQ number 142 to run on CPU0:
  
-<code bash>echo 1 > /proc/irq/142/smp_affinity</code>+<code bash>echo 1 > /proc/irq/124/smp_affinity</code>
  
 To set the core affinity use a bitmask, e.g.: To set the core affinity use a bitmask, e.g.:
Line 35: Line 36:
 To monitor the irqbalance load across cores check: To monitor the irqbalance load across cores check:
 <code bash>cat /proc/interrupts</code> <code bash>cat /proc/interrupts</code>
 +
 +==== Caution ====
 +
 +Irqbalance will result in performance benefits for multicore targets where there is enough CPU overhead to handle context switching. However on 2core targets, outside of benchmarking alone, there may be performance losses. This can happen if affinity selection is not done carefully (e.g. pinning ethernet to cpu0 and wireless to cpu1). This may result in increased latency or overhead such as with simultaneous users on LAN and WLAN. Irqbalance is more viable on 4core systems and up, however your mileage may vary. See forum discussion: https://forum.openwrt.org/t/kong-pro-firmware-for-ipq806x-r7500-r7800-ea8500/55694/395.
  
 ==== Examples ==== ==== Examples ====
  
-Examples for some common targets:+Example ''/proc/interrupts'' outputs for some common targets:
  
-[[toh:linksys:wrt_ac_series|WRT3200ACM]]:+[[toh:linksys:wrt_ac_series|WRT32X]]:
 <code> <code>
            CPU0       CPU1                   CPU0       CPU1       
Line 132: Line 137:
 ==== References ==== ==== References ====
  
-Note 1: upstream man page: https://linux.die.net/man/1/irqbalance+Note 1: man page: https://linux.die.net/man/1/irqbalance
  
 Note 2: upstream github: https://github.com/Irqbalance/irqbalance/ Note 2: upstream github: https://github.com/Irqbalance/irqbalance/
 +
  • Last modified: 2024/12/02 22:08
  • by palebloodsky