OPNsense Forum

English Forums => 25.7, 25.10 Series => Topic started by: rafaelbs on October 24, 2025, 05:38:26 AM

Title: Kernel Parameters on Tunables not working.
Post by: rafaelbs on October 24, 2025, 05:38:26 AM
Hi,

I have been trying to do change a few parameters to improve performance (https://docs.opnsense.org/troubleshooting/performance.html).

After adding the following tunables like:
net.isr.bindthreads = 1
net.isr.maxthreads = -1
net.inet.rss.enabled = 1

and reboot, nothing happens. When searching with sysctl -a, for example, still net.inet.rss.enabled shows 0.

There are not any other equals parameters conflicting. I already tried to change the loader.conf.local, which also did not work.

Any ideas about what am I doing wrong?

Thanks a lot.
Title: Re: Kernel Parameters on Tunables not working.
Post by: meyergru on October 24, 2025, 09:48:35 AM
How did you set the tuneables? Did you add them under "System: Settings: Tunables"?

Title: Re: Kernel Parameters on Tunables not working.
Post by: rafaelbs on October 24, 2025, 02:54:57 PM
Yes. I did under System: Settings: Tunables, but nothing happens.

We are running last version, completely updated.

I already tried with /boot/loader.conf.local and did not work.
Title: Re: Kernel Parameters on Tunables not working.
Post by: meyergru on October 24, 2025, 06:42:59 PM
That is virtually impossible. Did you apply the settings after creating the variables?

BTW: You should not edit configuration files by hand, as they will be overwritten by the OpnSense config. IDK if /boot/loader.conf.local is being honored. There is a folder /boot/loader.conf.d where files can be put.

That you can check: When you apply the tuneables settings, they should turn up in /boot/loader.conf ("fgrep net.isr.bindthreads /boot/loader.conf").
Title: Re: Kernel Parameters on Tunables not working.
Post by: jonny5 on October 24, 2025, 11:02:00 PM
There's one isr setting that I believe really enables the rest, see attached image too.

net.isr.dispatch: deferred
Title: Re: Kernel Parameters on Tunables not working.
Post by: pfry on October 25, 2025, 12:05:54 AM
Quote from: jonny5 on October 24, 2025, 11:02:00 PMThere's one isr setting that I believe really enables the rest, see attached image too.

net.isr.dispatch: deferred

Interesting. I'd figure "net.inet.rss.enabled" would be the... enabler. I have "direct" (the default), and actual dispatch is mostly "hybrid":

root@fw:/home/user # sysctl net.isr
net.isr.numthreads: 16
net.isr.maxprot: 16
net.isr.defaultqlimit: 256
net.isr.maxqlimit: 10240
net.isr.bindthreads: 1
net.isr.maxthreads: 16
net.isr.dispatch: direct
root@fw:/home/user # sysctl net.inet | grep rss
net.inet.rss.bucket_mapping: 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
net.inet.rss.enabled: 1
net.inet.rss.debug: 0
net.inet.rss.basecpu: 0
net.inet.rss.buckets: 8
net.inet.rss.maxcpus: 64
net.inet.rss.ncpus: 16
net.inet.rss.maxbits: 7
net.inet.rss.mask: 7
net.inet.rss.bits: 3
net.inet.rss.hashalgo: 2
root@fw:/home/user # netstat -Q
Configuration:
Setting                        Current        Limit
Thread count                        16          16
Default queue limit                256        10240
Dispatch policy                direct          n/a
Threads bound to CPUs          enabled          n/a

Protocols:
Name  Proto QLimit Policy Dispatch Flags
ip        1  1024    cpu  hybrid  C--
igmp      2    256 source  default  ---
rtsock    3    256 source  default  ---
arp        4    256 source  default  ---
ether      5    256    cpu  direct  C--
ip6        6  1024    cpu  hybrid  C--
ip_direct    9    256    cpu  hybrid  C--
ip6_direct    10    256    cpu  hybrid  C--
[...]

I believe the dispatch takes a bit of time to settle, but it's been a while since I set it up.