About performance

Started by hushcoden, October 24, 2024, 02:55:39 PM

Previous topic - Next topic
October 24, 2024, 02:55:39 PM Last Edit: October 24, 2024, 07:10:27 PM by hushcoden
While reading the document https://docs.opnsense.org/troubleshooting/performance.html I decided to enable RSS (my appliance has got 4x i225 ports and a Celeron J4125, 4 cores) and after reboot I've noticed that the value of net.inet.rss.bits is set to 3: just courious to understand why consdering that before enabling RSS the value was correctly set to 2...  ::)

Also, I read in the guide that if RSS is enabled with the 'enabled' sysctl, the packet dispatching policy will move from 'direct' to 'hybrid'. But not for me as even after rebooting, the dispatching policy is still 'direct', and should I set a tuneable to change that to 'hybrid'? Or would it be better to change that to 'deferred' considering my connection is PPPoE?

Tia.

Quote from: hushcoden on October 24, 2024, 02:55:39 PM
While reading the document https://docs.opnsense.org/troubleshooting/performance.html I decided to enable RSS (my appliance has got 4x i225 ports and a Celeron J4125, 4 cores) and after reboot I've noticed that the value of net.inet.rss.bits is set to 3: just courious to understand why consdering that before enabling RSS the value was correctly set to 2...  ::)

Also, I read in the guide that if RSS is enabled with the 'enabled' sysctl, the packet dispatching policy will move from 'direct' to 'hybrid'. But not for me as even after rebooting, the dispatching policy is still 'direct', and should I set a tuneable to change that to 'hybrid'? Or would it be better to change that to 'deferred' considering my connection is PPPoE?

Tia.

I can't tell from the post how RSS was implemented. Are you saying that you turned it on with sysctl via CLI, or did you add tunables to enable it?

The tunables should be permanent and survive reboots. The sysctl options usually will not survive a reboot if just enabling a feature to test. Screenshots attached as an example of my config.

If you configure it per the screenshot, when you run a 'netstat -Q' you'll see the following:
netstat -Q
Configuration:
Setting                        Current        Limit
Thread count                         4            4
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   1000    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   1000    cpu   hybrid   C--
ip_direct     9    256    cpu   hybrid   C--
ip6_direct    10    256    cpu   hybrid   C--

Great, thanks, and my netstat -Q output is exactly like yours, so I believe all sorted now.

Hi @opnfwb

Question on threads vs cores.

netstat -Q displays Thread count and the documentation refers to cores, I have a 4 core 8 thread system so I set the net.inet.rss.bits = 3 is that correct?

Normally the OS sees a thread as a core/vcore, but I wanted to make sure.

Results from my netstat -Q show Thread count as 8 so I presume it's correct?

thanks

While I don't claim to be the expert on this, I would use the same config (3). I think matching it to the thread count makes the most sense.

That said, it doesn't hurt to try 2 and 3 and see if you notice a difference. I would guess anything under 1gbps and it probably won't be noticeable?