Can we load balance cores more efficiently?

Here is an example of the core by core usage of openwrt

Seems like most processes on openwrt utilize only one core, my question is, can we either find some kind of balance when using the cores? This is without sqm and is just 50mbps nat on the xrx200 target TD-W9980. I think it should be possible to use both cores more or less equally, maybe use one core for nat4 and the other for firewall and nat6 and luci?

Have you tried the irqbalance package?

And you can also manually assign IRQs to the cores.

3 Likes

Is that not default on the snapshots?

No.
Practically no add-on packages are included by default. There haven't been that many multi-core CPUs in routers, earlier.

(and irqbalance is not perfect, but can help you to some extent)

2 Likes

Do I install by searching irqbalance on luci or do I need to recompile, how is the package called?

irqbalance

You can install it with opkg (in SSH console, or LuCI package management).

Maybe wrong name?

Have you already updated the packages lists?
"Update lists..."

1 Like


Yes, but it doesn't get play though the gif on this site, you can check the image source for the full "video"

It plays it ok.
You have apparently a buggy version of LuCI from a few days ago. It doesnät play well with empty packages lists.

use the SSH console.

opkg update
opkg install irqbalance

I have patched my repo to add /usr/bin/taskset to util-linux, which allows processes to be pinned to different cores. IMHO, this should probably be included in future releases of openwrt, as it's super useful for optimizing usage on multi-core machines.

irqbalance is very disappointing and has never had much utility for me.

I find the best results come from manually assigning IRQs to cores. It's a bit of a tedious process to get to an optimal setting, but it can make a very large difference especially on very high bandwidth connections.

For example, on my ixgbe driver, different combinations of irq affinities on the ingress and egress interfaces can lead to wildly different behaviour, for example processing the interrupts generated for a single gigabit flow either on one core or on all cores.

BusyBox v1.33.0 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r16313-851dadc257
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:~# opkg update
Downloading https://downloads.openwrt.org/snapshots/targets/lantiq/xrx200/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading https://downloads.openwrt.org/snapshots/targets/lantiq/xrx200/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/packages/mips_24kc/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading https://downloads.openwrt.org/snapshots/packages/mips_24kc/base/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/targets/lantiq/xrx200/kmods/5.4.106-1-2d286b7a0ded3d4742e795fb821709a1/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_kmods
Downloading https://downloads.openwrt.org/snapshots/targets/lantiq/xrx200/kmods/5.4.106-1-2d286b7a0ded3d4742e795fb821709a1/Packages.sig
Signature check passed.
root@OpenWrt:~# opkg install irqbalance
Unknown package 'irqbalance'.
Collected errors:
 * opkg_install_cmd: Cannot install package irqbalance.
root@OpenWrt:~#

I have a broken install?

Can you share the patch?

Looks like that.
You do not fetch packages from the feeds, only from the main OpenWrt.

Probably something non-default in /etc/opkg/distfeeds.conf
(or your lantiq xrx200 subtarget is broken?)

Can I have your distfeeds.conf? Also here is mine for reference

src/gz openwrt_core https://downloads.openwrt.org/snapshots/targets/lantiq/xrx200/packages
src/gz openwrt_base https://downloads.openwrt.org/snapshots/packages/mips_24kc/base
src/gz openwrt_kmods https://downloads.openwrt.org/snapshots/targets/lantiq/xrx200/kmods/5.4.106-1-2d286b7a0ded3d4742e795fb821709a1

I use a different router with different package architecture, so it has no direct value for you. Different directories.

But it should looks something like this:

root@router1:~# cat /etc/opkg/distfeeds.conf
src/gz openwrt_core https://downloads.openwrt.org/snapshots/targets/ipq806x/generic/packages
src/gz openwrt_base https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base
src/gz openwrt_luci https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci
src/gz openwrt_packages https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages
src/gz openwrt_routing https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing

Note the snapshots/packages/arm_cortex-a15_neon-vfpv4/... items.
You only had the "base" but no luci, packages, routing

Are you using a buildbot snapshot, downloaded from the OpenWrrt download repo?
Or something selfmade with imagebuilder?

If yes, then I am just wondering, if there is something buggy in the inclusion of the feeds dwnload repos.

I am using the config from the firmware releases for 19.07.7 then applying some patches from pull requests and then updating and installing as the build guide recommends then make defconfig then menuconfig so I only compile my device then putting my dsl firmware in source/files/lib/firmware/dsl.bin and then make download and finally make -j5 and it works.

Not anymore, I installed it now, does it need any config?

src/gz openwrt_core https://downloads.openwrt.org/snapshots/targets/lantiq/xrx200/packages
src/gz openwrt_base https://downloads.openwrt.org/snapshots/packages/mips_24kc/base
src/gz openwrt_luci https://downloads.openwrt.org/snapshots/packages/mips_24kc/luci
src/gz openwrt_packages https://downloads.openwrt.org/snapshots/packages/mips_24kc/packages
src/gz openwrt_routing https://downloads.openwrt.org/snapshots/packages/mips_24kc/routing
src/gz openwrt_kmods https://downloads.openwrt.org/snapshots/targets/lantiq/xrx200/kmods/5.4.106-1-2d286b7a0ded3d4742e795fb821709a1

Do I need to configure anything?

Do you have the tool or patch somewhere?