Increasing CPU Efficiency

Hi everyone, I have a router with a MediaTek MT7621 CPU and I've configured the IRQ settings like this, and my internet is a bit more stable. Do you have any suggestions on how to make the CPU work more efficiently with these IRQ settings, or can I get the best performance with these settings?

Hostname	OpenWrt
Model	Xiaomi Mi Router 4A Gigabit Edition
Architecture	MediaTek MT7621 ver:1 eco:3
Target Platform	ramips/mt7621
root@OpenWrt:~# cat /proc/interrupts
           CPU0       CPU1       CPU2       CPU3       
  8:     186134     220702     374616     402828  MIPS GIC Local   1  timer
  9:     679050          0          0          0  MIPS GIC  63  IPI call
 10:          0     140508          0          0  MIPS GIC  64  IPI call
 11:          0          0    1383897          0  MIPS GIC  65  IPI call
 12:          0          0          0     286261  MIPS GIC  66  IPI call
 13:       9057          0          0          0  MIPS GIC  67  IPI resched
 14:          0       1534          0          0  MIPS GIC  68  IPI resched
 15:          0          0       5580          0  MIPS GIC  69  IPI resched
 16:          0          0          0       1540  MIPS GIC  70  IPI resched
 17:          0          0          0          0  MIPS GIC  19  1e000600.gpio-bank0, 1e000600.gpio-bank1, 1e000600.gpio-bank2
 18:         12          0          0          0  MIPS GIC  33  ttyS0
 19:        345     595779          0          0  MIPS GIC  10  1e100000.ethernet
 20:          0          0          0          0  MIPS GIC  30  mt7530
 23:          0          0          0          0    mt7530   2  mt7530-0:02
 24:          0          0          0          0    mt7530   3  mt7530-0:03
 25:          0          0          0          0  mt7621-gpio  18  keys
 26:          0          0          0          0  MIPS GIC  26  1e004000.crypto
 27:         22          0          0          0  MIPS GIC  31  mt7603e
 28:       1165    1435720          0          0  MIPS GIC  11  mt76x2e
ERR:       1103
root@OpenWrt:~# uptime
 21:01:36 up  2:18,  load average: 0.05, 0.05, 0.00
root@OpenWrt:~# 

As you've been told before, get beefier hw.

1 Like

First is that 1st and 2nd CPU pairs are actually sharing 2 cores. And even then you run both network interrupts on same core. Could help balancing either ethernet or wifi to cores 2/3

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button (red circle; this works best in the 'Markdown' composer view in the blue oval):

Screenshot 2025-10-20 at 8.14.14 PM

Remember to redact passwords, VPN keys, MAC addresses and any public IP addresses you may have:

ubus call system board

You can seek some fw4 patches to reduce CPU/memory usage for packet forwarding, but dont expect wonders.

2 Likes
root@OpenWrt:~# cat /proc/interrupts
           CPU0       CPU1       CPU2       CPU3       
  8:     148572      79347      91102      85988  MIPS GIC Local   1  timer
  9:     527754          0          0          0  MIPS GIC  63  IPI call
 10:          0      55873          0          0  MIPS GIC  64  IPI call
 11:          0          0     143816          0  MIPS GIC  65  IPI call
 12:          0          0          0     120931  MIPS GIC  66  IPI call
 13:       6141          0          0          0  MIPS GIC  67  IPI resched
 14:          0       1793          0          0  MIPS GIC  68  IPI resched
 15:          0          0      32604          0  MIPS GIC  69  IPI resched
 16:          0          0          0       1512  MIPS GIC  70  IPI resched
 17:          0          0          0          0  MIPS GIC  19  1e000600.gpio-bank0, 1e000600.gpio-bank1, 1e000600.gpio-bank2
 18:         12          0          0          0  MIPS GIC  33  ttyS0
 19:         67     506170          0          0  MIPS GIC  10  1e100000.ethernet
 20:          0          0          0          0  MIPS GIC  30  mt7530
 23:          0          0          0          0    mt7530   2  mt7530-0:02
 24:          0          0          0          0    mt7530   3  mt7530-0:03
 25:          0          0          0          0  mt7621-gpio  18  keys
 26:          0          0          0          0  MIPS GIC  26  1e004000.crypto
 27:         23          0          0          0  MIPS GIC  31  mt7603e
 28:        217          0     832750          0  MIPS GIC  11  mt76x2e
ERR:        413
root@OpenWrt:~# 

I did as you said, and now it's much more stable. Did I do it right?

I've currently distributed network operations to shortcut CPU 1 (number 19), set Wi-Fi to CPU 2, and the small values ​​on CPU 0 are boot-time values; they're not working.

1 Like

Normally that is done by irqbalance but did not work on ramips (last time I checked)...
You can save 1/3 iifname matches per forwarded packet by https://github.com/openwrt/firewall4/pull/27
And replace one payload examination with integer comparison https://github.com/openwrt/firewall4/pull/31
Those are per-packet slack processing....

3 Likes

Can this particular router do sqm?

Which router do you recommend for average users

Depends on speed, rockchip or filogic will sqm gigabit if that is the question. Ask in a new thread if you need more exotic config.
7621 will do ok for 100-300Mbps

Dumb question - if I'm reading this correctly cpu 1 & 2 share 1 core, 2 & 3 the other. Is this correct?

Thanks!

1 Like

Thank you

One more question:

Should I enable packet steering for sqm on this router? If so, should I simply select ‘enabled’ or ‘enabled (all cpu cores)’

Should I touch Steering flows (RPS)? It's shown as ‘Standard none’

That tends to help. On dual core routers selecting "all CPUs" is essential, with SMT I assume as well, but am not 100% sure as I lack an openWrt device with SMT.

I must say I would be (positively) surprised if the upper end of that estimate was the case... 880 MHz with ancient MIPS cores

I've had a look at the links and the 1st one consists of just random AI stuff. The 2nd one is OpenWrt related and looks like someone's personal 'optimisation'. I would recommend people to read through any scripts and understand what they do before running them on your router.

5 Likes

2nd one also has broccolis in output and network part does nothing (sets fw mark on supposedly lan on x86 then that is consumed by noqueue at best)

1 Like

Could you teach me how to do this on OpenWRT? Thanks. I keep the helper modules disabled in daily use.

inet fw4 prerouting

[ meta load iifname => reg 1 ]

[ cmp eq reg 1 0x6c2d7262 0x00006e61 0x00000000 0x00000000 ]

[ immediate reg 0 jump -> helper_lan ]

userdata = { \x00-!fw4: Handle lan IPv4/IPv6 helper assignment\x00 }

-d netlink