Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    OpenVPN Slow - local network test

    Scheduled Pinned Locked Moved OpenVPN
    38 Posts 5 Posters 4.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • RicoR
      Rico LAYER 8 Rebel Alliance
      last edited by

      Did you try with GCM or still CBC?
      Also try to set

      sndbuf 524288
      rcvbuf 524288
      

      -Rico

      S 1 Reply Last reply Reply Quote 0
      • S
        spyder0552 @Rico
        last edited by

        @Rico
        Buffers go in the server config, client config or both?

        1 Reply Last reply Reply Quote 0
        • RicoR
          Rico LAYER 8 Rebel Alliance
          last edited by

          Set the Send/Receive Buffer on both.

          -Rico

          S 1 Reply Last reply Reply Quote 0
          • S
            spyder0552
            last edited by

            Thank you for trying to help btw.
            Changed to use GCM and set the buffers on both sides...actually made it a little worse.

            I am totally baffled by this. I know it can work and is not the network. Just something in OpenVpn is throttling it all down.

            1 Reply Last reply Reply Quote 0
            • S
              spyder0552 @Rico
              last edited by

              @Rico
              Also, wondering if I need to set the tunnel size.
              Pinging at 1500 shows fragmentation. Setting it to 1472 shows no frag. (hitting a box on the remote network of course).

              What do you think?

              1 Reply Last reply Reply Quote 0
              • johnpozJ
                johnpoz LAYER 8 Global Moderator
                last edited by

                I would take a look at this
                https://community.openvpn.net/openvpn/wiki/Gigabit_Networks_Linux

                An intelligent man is sometimes forced to be drunk to spend time with his fools
                If you get confused: Listen to the Music Play
                Please don't Chat/PM me for help, unless mod related
                SG-4860 24.11 | Lab VMs 2.8, 24.11

                S 1 Reply Last reply Reply Quote 0
                • S
                  spyder0552 @johnpoz
                  last edited by

                  @johnpoz
                  Thanks, I did read this but going to go over again to see if I missed something.
                  I know it talks about jumbo frames....will try that and let everyone know what i find.

                  1 Reply Last reply Reply Quote 0
                  • RicoR
                    Rico LAYER 8 Rebel Alliance
                    last edited by

                    Pls run those two via the command line or SSH and post the output here

                    openvpn --genkey --secret /tmp/secret
                    time openvpn --test-crypto --secret /tmp/secret --verb 0 --tun-mtu 20000 --cipher aes-128-gcm
                    

                    -Rico

                    S 1 Reply Last reply Reply Quote 0
                    • S
                      spyder0552 @Rico
                      last edited by

                      @Rico

                      [2.4.5-RELEASE][admin@pfSense.seradex.local]/root: openvpn --genkey --secret /tm p/secret
                      [2.4.5-RELEASE][admin@pfSense.seradex.local]/root: time openvpn --test-crypto -- secret /tmp/secret --verb 0 --tun-mtu 20000 --cipher aes-128-gcm
                      Fri Jun 19 14:47:16 2020 disabling NCP mode (--ncp-disable) because not in P2MP client or server mode
                      10.007u 0.000s 0:10.00 100.0% 843+177k 0+0io 0pf+0w
                      [2.4.5-RELEASE][admin@pfSense.seradex.local]/root:

                      S 1 Reply Last reply Reply Quote 0
                      • S
                        spyder0552 @spyder0552
                        last edited by

                        @spyder0552
                        Also just did a test one using UDP and setting the tunnel size to 9000....but still same results

                        1 Reply Last reply Reply Quote 0
                        • RicoR
                          Rico LAYER 8 Rebel Alliance
                          last edited by

                          Hmm with this output I'd expect more than ~165 Mbps but you will never get to 1 Gbps with this CPU and OpenVPN, not even close.
                          Run again your iperf via the tunnel and check top -aSH - does the OpenVPN process run close to 100%?
                          Also for testing try with Encryption Algorithm set to None and try iperf via the tunnel again.

                          -Rico

                          S 1 Reply Last reply Reply Quote 0
                          • S
                            spyder0552 @Rico
                            last edited by

                            @Rico
                            From what I see, no where near any cpu usage
                            Top.png

                            S 1 Reply Last reply Reply Quote 0
                            • S
                              spyder0552 @spyder0552
                              last edited by

                              @spyder0552
                              Back on this again now. Anyone have suggestions?
                              This is all on the same network using Cat6 cables. Just testing from a laptop to the wall to a device on the other side.
                              No VPN - Speed is fantastic.
                              OpenVPN tunnel - speed is pathetic.

                              Any help would be appreciated before I have to dump this and look to another solution. I just can't believe that OpenVPN can't handle at least 400-600 Mbs.

                              Thanks all.

                              1 Reply Last reply Reply Quote 0
                              • RicoR
                                Rico LAYER 8 Rebel Alliance
                                last edited by

                                Did you try with Encryption Algorithm set to None for testing?
                                If you really aim for highspeed VPN traffic I think you need to try with IPsec. 😐

                                -Rico

                                S 1 Reply Last reply Reply Quote 0
                                • johnpozJ
                                  johnpoz LAYER 8 Global Moderator
                                  last edited by

                                  I'm about ready to head out - but I I want to try and see what my 4860 can do via this local sort of testing.. If find some time will do a local only test..

                                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                                  If you get confused: Listen to the Music Play
                                  Please don't Chat/PM me for help, unless mod related
                                  SG-4860 24.11 | Lab VMs 2.8, 24.11

                                  S 1 Reply Last reply Reply Quote 0
                                  • S
                                    spyder0552 @johnpoz
                                    last edited by

                                    @johnpoz
                                    Hi all.
                                    So, still having the same issue. I have now setup a home lab and get the exact same results.
                                    Test Lab:
                                    Intel i5 with 32Gb Ram.
                                    Using Windows HyperV as the host.
                                    Pfsense and Windows10 as guest machines.

                                    Test 1 = laptop -> Firewall -> Windows 10
                                    Get ~900 Mb/s

                                    Test 2 = Laptop with OpenVP -> Firewall -> Windows 10
                                    Get ~ 170 Mb/s

                                    This is the same results I am seeing at my office using Dell R610 with 24 CPU Xenon's.

                                    Things I have tried:

                                    1. Enable/disable the network options Hardware TCP Seg and Large Receive Offload (check box set to disable them).
                                    2. Enable fast I/O (with it turned off, I go down to ~155-160)...so currently enabled.
                                    3. Snd/rcv buffers. Tried default and 2Mb. No significant change.
                                    4. Encryption at AES-128-CBC and GCM. No significant change.

                                    So for anyone that wants to setup my test enviroment:

                                    1. Just setup a HyperV box.
                                    2. Add 2 virtual switches (one external and one internal).
                                    3. Create a VM for Pfsense and give it both virtual switches (WAN = External, LAN = Internal switch).
                                    4. Create a VM for a test box
                                    5. Put Iperf on the test box
                                    6. Create your PFsense with default OpenVPN (using TLS). Just run through the wizard.

                                    I am sure if someone did this they would get to the same spot I am where the speed is just no where at what it should be capable of.
                                    You can rule the hardware out to some extent as testing without the VPN shows near full speed (meaning the nics are talking to each other properly).

                                    Anyone willing to try my test?

                                    johnpozJ 1 Reply Last reply Reply Quote 0
                                    • S
                                      spyder0552 @Rico
                                      last edited by

                                      @Rico
                                      Hey, just replied below. Yes, I did try that on Friday and it did not make a difference.

                                      Is anyone out there trying this with Windows 10 clients? Perhaps this is a windows issue?

                                      1 Reply Last reply Reply Quote 0
                                      • PippinP
                                        Pippin
                                        last edited by

                                        @spyder0552 said in OpenVPN Slow - local network test:

                                        [2.4.5-RELEASE][admin@pfSense.seradex.local]/root: openvpn --genkey --secret /tm p/secret
                                        [2.4.5-RELEASE][admin@pfSense.seradex.local]/root: time openvpn --test-crypto -- secret /tmp/secret --verb 0 --tun-mtu 20000 --cipher aes-128-gcm
                                        Fri Jun 19 14:47:16 2020 disabling NCP mode (--ncp-disable) because not in P2MP client or server mode
                                        10.007u 0.000s 0:10.00 100.0% 843+177k 0+0io 0pf+0w
                                        [2.4.5-RELEASE][admin@pfSense.seradex.local]/root:

                                        By the looks of that ^^^ it theoretically could do ~320Mbps

                                        How about testing both ways? (client>server - server>client)
                                        Which I5 is that?

                                        Your top -aSH screenshot is timed wrong, ..... I guess.

                                        I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
                                        Halton Arp

                                        S 1 Reply Last reply Reply Quote 0
                                        • S
                                          spyder0552 @Pippin
                                          last edited by

                                          @Pippin
                                          Home test lab is i5-4690K (yeah..little dated...best I can get atm).

                                          I can't really get it to test from the inside out. The wall seems to be blocking it out. I guess the IP I would connect to would be the end point of the tunel...but not working it seems.

                                          1 Reply Last reply Reply Quote 0
                                          • PippinP
                                            Pippin
                                            last edited by

                                            You can reverse test mode by using iperf3 -R
                                            "-R, Reverse test mode – Server sends, client receives"

                                            I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
                                            Halton Arp

                                            S 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.