How can we make openvpn to utilize multiple cores ?

This is the forum to post your config. Include diagrams, usage graphs, and all the other goodies to show off your network.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
chariac463
OpenVpn Newbie
Posts: 2
Joined: Tue Mar 22, 2022 11:56 am

How can we make openvpn to utilize multiple cores ?

Post by chariac463 » Tue Mar 22, 2022 11:58 am

Hi,

I understood that OpenVpn uses single core/cpu for processing and I want to understand the config changes to be done for making the OpenVpn utilizing multiple cores and it should be based on load but not for different subnets.


Can anyone help me on answering my question please.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: How can we make openvpn to utilize multiple cores ?

Post by TinCanTech » Tue Mar 22, 2022 3:58 pm

Openvpn is single threaded.

User avatar
openvpn_inc
OpenVPN Inc.
Posts: 1332
Joined: Tue Feb 16, 2021 10:41 am

Re: How can we make openvpn to utilize multiple cores ?

Post by openvpn_inc » Wed Mar 23, 2022 1:19 am

Hi char,

OpenVPN Access Server uses a kludge to distribute client connections among multiple listening openvpn daemons, which are one per CPU core, on different cores. The VPN address pools are split up into parts; for example, with 4 CPU cores and a /20 netblock and one daemon per each of TCP and UDP, each daemon would get a /23 of addresses. (The pool/pools is/are divided into 8 parts.) Elaborate iptables(8) DNAT rules direct a new client connection to the least busy core.

To be honest I do not know how those processes are assigned to the separate cores. I always have wondered about that. I guess I am in a good position to ask. :)

Access Server is free (gratis) for use for no more than 2 concurrent connections, so feel free to check it out if you're interested.

Community openvpn version 2.6 will have a DCO (data channel offload) feature which will do a cleaner job of sharing the workload among multiple CPU cores. It's in active development now, available for Linux (using a kernel module) and soon as a patch for the BSD kernel. See https://community.openvpn.net/openvpn/w ... fOpenvpn26 for information

Perhaps you'd be interested in helping to beta test it? If so IRC is a good place for that. Every Wednesday afternoon (European time) is a community meeting on IRC. See https://community.openvpn.net/openvpn/wiki/IrcMeetings for information, including agendas and chat logs. I can rarely go because I'm in UTC-5.

regards, rob0
Image OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support

chariac463
OpenVpn Newbie
Posts: 2
Joined: Tue Mar 22, 2022 11:56 am

Re: How can we make openvpn to utilize multiple cores ?

Post by chariac463 » Thu Mar 24, 2022 5:39 am

Hi ,

Do you mean openvpn access utilizes 1 core for 1 subnet ?

Another query is, If we run multiple instances of openvpn, does one instance takes one core ?

Post Reply