Discussion:
renice and network forwarding
(too old to reply)
Tom Smyth
2017-12-03 21:13:52 UTC
Permalink
Hello all,

just wondering if anyone else has tried using renice to
de-prioritise other processes in an effort to give more cpu
time to packet forwarding in the kernel ?

While Im certain that there significant risks to system stability
and other functionality of the system if one were to carpet bomb
the process list pids with renice 20. Perhaps the current defaults
are for general purpose systems ? Perhaps other network
Administrators have tweaked background processes where a system
was a single purpose system such as a Router, Firewall or Bridge.

Also is the softnet process (as seen by command top -SH) only
interrupt handling of packets ?
or does it cover processing (e.g. forwarding if enabled ) (either
bridging or routing depending on network config)

any advice welcome ...

Thanks
Tom Smyth
Theo de Raadt
2017-12-03 21:17:06 UTC
Permalink
won't help.

it does not adjust the scheduler in that way, at all
Post by Tom Smyth
just wondering if anyone else has tried using renice to
de-prioritise other processes in an effort to give more cpu
time to packet forwarding in the kernel ?
While Im certain that there significant risks to system stability
and other functionality of the system if one were to carpet bomb
the process list pids with renice 20. Perhaps the current defaults
are for general purpose systems ? Perhaps other network
Administrators have tweaked background processes where a system
was a single purpose system such as a Router, Firewall or Bridge.
Also is the softnet process (as seen by command top -SH) only
interrupt handling of packets ?
or does it cover processing (e.g. forwarding if enabled ) (either
bridging or routing depending on network config)
any advice welcome ...
Thanks
Tom Smyth
Martin Pieuchot
2017-12-04 10:09:55 UTC
Permalink
Post by Tom Smyth
Hello all,
just wondering if anyone else has tried using renice to
de-prioritise other processes in an effort to give more cpu
time to packet forwarding in the kernel ?
The thread responsible for processing packets being forwarded is
'softnet'. Like almost all others kernel threads is has a higher
priority than userland processes. So renice is useless in that case.

This thread already uses as much CPU time as possible. What is your
problem? What do you want to achieve?
Post by Tom Smyth
While Im certain that there significant risks to system stability
and other functionality of the system if one were to carpet bomb
the process list pids with renice 20. Perhaps the current defaults
are for general purpose systems ? Perhaps other network
Administrators have tweaked background processes where a system
was a single purpose system such as a Router, Firewall or Bridge.
There's no such performance tweak. However note that if you're
bridging interfaces you might suffer. That's because nobody did
the work to take the bridge(4) out of the KERNEL_LOCK(). So it's
a totally different issue than the forwarding path.
Post by Tom Smyth
Also is the softnet process (as seen by command top -SH) only
interrupt handling of packets ?
It's processing all incoming packets.
Post by Tom Smyth
or does it cover processing (e.g. forwarding if enabled ) (either
bridging or routing depending on network config)
All of them but some configurations work better because they don't
require to grab the KERNEL_LOCK().
Post by Tom Smyth
any advice welcome ...
What do you want to achieve? Better performances? With which setup?

Cheers,
Martin
Tom Smyth
2017-12-31 13:32:51 UTC
Permalink
Hi Lads,
Sorry for the delay some other project work got in my way
@martin Please find my responses to your queries in line
Post by Martin Pieuchot
The thread responsible for processing packets being forwarded is
'softnet'. Like almost all others kernel threads is has a higher
priority than userland processes. So renice is useless in that case.
This thread already uses as much CPU time as possible. What is your
problem? What do you want to achieve?
I just wanted to squeeze more performance out of a router I thought
(wrongly) that if OpenBSD out of the box was for general computing
that some CPU
time would be sacrificed by default to accomodate general user loads,
Disk i/o Graphics etc..
Thanks for the carlification about the kernel threads vs userland threads
Post by Martin Pieuchot
There's no such performance tweak. However note that if you're
bridging interfaces you might suffer. That's because nobody did
the work to take the bridge(4) out of the KERNEL_LOCK(). So it's
a totally different issue than the forwarding path.
Yes Im using the Bridge to bridge a group of individual vlan interfaces from
a wholesale provider and then merge them onto the one vlan interface.
so forwarding in bridge is limited by performance of 1 CPU for bridge
forwarding

Just to clarify can I double performance by running 2 Bridges and splitting load
instead of using 1x uplink bridged to 100 vlans on one bridge
use 2x uplinks each into their own bridge and then each bridge with
50vlans each
would that provide improved performance or is it one thread / process
for bridge forwarding
regardless the number of bridges
Post by Martin Pieuchot
Post by Tom Smyth
Also is the softnet process (as seen by command top -SH) only
interrupt handling of packets ?
It's processing all incoming packets.
Thanks
Post by Martin Pieuchot
Post by Tom Smyth
or does it cover processing (e.g. forwarding if enabled ) (either
bridging or routing depending on network config)
All of them but some configurations work better because they don't
require to grab the KERNEL_LOCK().
Post by Tom Smyth
any advice welcome ...
What do you want to achieve? Better performances? With which setup?
In this case Im simply using OpenBSD as a bridging devices to combine
(bridge) a load of vlans
into 1vlan, each vlan is isolated using pf to limit broadcast domains..
Post by Martin Pieuchot
Cheers,
Martin
--
Kindest regards,
Tom Smyth

Mobile: +353 87 6193172
The information contained in this E-mail is intended only for the
confidential use of the named recipient. If the reader of this message
is not the intended recipient or the person responsible for
delivering it to the recipient, you are hereby notified that you have
received this communication in error and that any review,
dissemination or copying of this communication is strictly prohibited.
If you have received this in error, please notify the sender
immediately by telephone at the number above and erase the message
You are requested to carry out your own virus check before
opening any attachment.
Loading...