[SOLVED] Define CPU process affinity

Post new topic   Reply to topic    DD-WRT Forum Index -> Marvell MVEBU based Hardware (WRT1900AC etc.)
Author Message
deedeedoubleyourt
DD-WRT Novice


Joined: 22 Oct 2021
Posts: 14

PostPosted: Tue Jul 19, 2022 0:31    Post subject: [SOLVED] Define CPU process affinity Reply with quote
How do I instruct my build to locate VPN + WAN on one core and LAN + wifi on the other?

Router: WRT3200ACM build: r47942
Sponsor
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Tue Jul 19, 2022 10:14    Post subject: Reply with quote
Ive taken the liberty to modify your thread title to something specific and edited your post to include the router/build details next to each other, this way people will better see whats what.

I dont think you can in DD-WRT.

You would define the process CPU core affinity and then define the process nice values (ideally).

DD-WRT is not a full blow Linux distro so it likely doesn't have the necessary functionality built in because it needs to be small and optimized.

At least I dont think DD-WRT has these built in. If you Google "Linux specify which CPU core handles what" you will see various topics and methods on this, so I will not duplicate the info here.

You could investigate however the use of entware or compile the necessary packages yourself in order to achieve this, Im not familiar with Marvel entware stuff, I dont think it will be possible or if possible it will require a great deal of hacking.

You wont be doing yourself any favors though. Understand OpenVPN is resource intensive, Wireguard would likely be easier on resources and faster since its a kernel space implementation vs userspace implementation.

This is an interesting question for regular ARM/MIPS so I will have a looksee and see whats available at least on my router, which will differ from yours most like.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12836
Location: Netherlands

PostPosted: Tue Jul 19, 2022 10:26    Post subject: Reply with quote
Most higher end routers can use core affinity

I do not know about Marvell but should think it also can.

Recent builds have irqbalance which dynamically distributes irq between cores
ps from CLI interface will show if that runs on your system, you probably have to kill it first if you want to set core affinity manually.

Problem with OpenVPN is that it is not multithreaded and has to frequently switch between user and kernel space.

If you seek performance VPN, WireGuard is the way to go, usually more than triple the speed of OpenVPN

Have a look at the R7800 install guide which has a chapter about Performance:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Tue Jul 19, 2022 13:20    Post subject: Reply with quote
So the Master-master Chief says DD-WRT already sets them as required in special processes but its available on /proc.

TBH This isnt something for the faint hearted so YMMV if you break something, remember your tweaks.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
deedeedoubleyourt
DD-WRT Novice


Joined: 22 Oct 2021
Posts: 14

PostPosted: Tue Jul 19, 2022 20:07    Post subject: Reply with quote
The question was posed as one of the Guru's posted a couple of years back in a thread "Have you balanced the task among cores? OpenVPN will use a single core. Locate VPN and WAN on one core and LAN + wifi on the other. The 'top' command will show what the cores are doing."
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Tue Jul 19, 2022 23:28    Post subject: Reply with quote
Referencing another thread without a link doesn't help for clarity in the rest of the community's minds, FYI. The response was in reference to a Netgear R6400v1 (Broadcom) router on NordVPN and you're asking about completely different hardware (Marvell):

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327363

There is probably an answer as to specifics in regards to your inquiry, but I don't have them without a device in hand and all of my DD-WRT Marvell devices are deployed outside of immediate reach. Hopefully one of the knowledgeable Marvell folks can help figure this out.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12836
Location: Netherlands

PostPosted: Wed Jul 20, 2022 11:27    Post subject: Reply with quote
deedeedoubleyourt wrote:
The question was posed as one of the Guru's posted a couple of years back in a thread "Have you balanced the task among cores? OpenVPN will use a single core. Locate VPN and WAN on one core and LAN + wifi on the other. The 'top' command will show what the cores are doing."


Yes I know that and I already answered you how you can check and set these kind of things (but that irqbalance should do it automatically (but I have never checked if it actually works) )

P.S. if you use the top command press c to show both cores

P.P.S some builds have htop (but for me it is a bit over the top Very Happy)

P.P.P.S Can we mark this thread as solved?

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
deedeedoubleyourt
DD-WRT Novice


Joined: 22 Oct 2021
Posts: 14

PostPosted: Wed Jul 20, 2022 13:34    Post subject: Reply with quote
egc wrote:
deedeedoubleyourt wrote:
The question was posed as one of the Guru's posted a couple of years back in a thread "Have you balanced the task among cores? OpenVPN will use a single core. Locate VPN and WAN on one core and LAN + wifi on the other. The 'top' command will show what the cores are doing."


Yes I know that and I already answered you how you can check and set these kind of things (but that irqbalance should do it automatically (but I have never checked if it actually works) )

P.S. if you use the top command press c to show both cores

P.P.S some builds have htop (but for me it is a bit over the top Very Happy)

P.P.P.S Can we mark this thread as solved?


My futile attempt in trying to get higher VPN speeds. Yes, we can consider this as solved. Thank You
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Wed Jul 20, 2022 14:28    Post subject: Reply with quote
WireGuard FTW

try it.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Wed Jul 20, 2022 16:00    Post subject: Reply with quote
Overriding irqbalance won't give you faster VPN. VPN speeds are limited by hardware power, no matter what you do.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
deedeedoubleyourt
DD-WRT Novice


Joined: 22 Oct 2021
Posts: 14

PostPosted: Wed Jul 20, 2022 17:26    Post subject: Reply with quote
the-joker wrote:
WireGuard FTW

try it.


Unfortunately not a good, straightforward option with Nord and their NordLynx.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12836
Location: Netherlands

PostPosted: Wed Jul 20, 2022 17:38    Post subject: Reply with quote
deedeedoubleyourt wrote:
the-joker wrote:
WireGuard FTW

try it.


Unfortunately not a good, straightforward option with Nord and their NordLynx.


Choose your provider wisely Smile

But there is a workaround to get WireGuard working with NordVPN

And before you are going to ask where I can I find it, it is in the manual (a sticky in the advanced networking forum ) Smile
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327397

You need the Client setup guide Smile

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Marvell MVEBU based Hardware (WRT1900AC etc.) All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum