I previously posted about setting up wireguard, that's now wrapped up.
viewtopic-t-1161123-highlight-.html
My experience in practical use is still that the network performance over WAN is much much worse than in the LAN. It doesn't make sense. The standard answer is "what do you expect, wi-fi is slow". But there is no wi-fi involved here. I have wired ethernet all the way. My WAN ping is 30ms (that's supposed to be good), there's no reason for network performance overall to suck. I'm being methodical about it, and already discovered a bum ethernet card, which I replaced.
I next want to show my testing of pure network performance using raw, ssh tunnel and wireguard tunnel methods. For those of you who don't want to read it all: Raw WAN connections are slower than connections on the LAN by only about 13%. Tunneling through ssh and wireguard is slower by about another 30-40%, and wireguard beats ssh head to head by about 35% in both transmit and receive. It's a very consistent and not so very surprising result, though I didn't expect wg to beat ssh by so much.
My setup is: local (pogacar) and remote (merckx) machines are both old-ish 3GHz core i7 machines with 16GB memory, connected by 1GBE to their respective providers. Ping is a consistent 30ms in both directions, and both get <1ms ping and 930 MB/s in their respective LANs. I have iperf3 server running on merckx. I run the iperf3 client on pogacar in both forward and reverse mode. So I can transfer data 6 ways: 1,2) by an open raw port in my router, 3,4) through an ssh tunnel (running on localhost:45201) on another open port, 5,6) through a wireguard tunnel in yet a third open public port.
This was a very simple test based on iperf3 default settings. I simply ran iperf3 in transmit and receive mode in both directions. I spent a few hours tuning various network parameters and found out, guess what: Linux has pretty good settings, don't mess with them. I could make network throughput dramatically *worse* without much effort, but never made a dent on improving either ssh or wg performance. So my recommendation is, don't mess with the default network settings. Smarter people than me created them.
Here are the command I ran
Code: Select all
jesnow@pogacar ~ $ cat netperf
#! /bin/bash
iperf3 -c merckx.vesarius.net -p 55202
iperf3 -c merckx.vesarius.net -p 55202 -R
iperf3 -c localhost -p 45201
iperf3 -c localhost -p 45201 -R
iperf3 -c merckxw
iperf3 -c merckxw -R
Here are the data.
Code: Select all
jesnow@pogacar ~ $ ./netperf
Connecting to host merckx.vesarius.net, port 55202
[ 5] local 130.39.190.4 port 54816 connected to 104.176.81.55 port 55202
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 85.2 MBytes 715 Mbits/sec 0 3.48 MBytes
[ 5] 1.00-2.00 sec 105 MBytes 881 Mbits/sec 0 3.48 MBytes
[ 5] 2.00-3.00 sec 104 MBytes 870 Mbits/sec 0 3.48 MBytes
[ 5] 3.00-4.00 sec 102 MBytes 860 Mbits/sec 0 3.48 MBytes
[ 5] 4.00-5.00 sec 105 MBytes 881 Mbits/sec 0 3.48 MBytes
[ 5] 5.00-6.00 sec 104 MBytes 871 Mbits/sec 0 3.48 MBytes
[ 5] 6.00-7.00 sec 104 MBytes 870 Mbits/sec 0 3.48 MBytes
[ 5] 7.00-8.00 sec 104 MBytes 870 Mbits/sec 0 3.48 MBytes
[ 5] 8.00-9.00 sec 105 MBytes 881 Mbits/sec 0 3.48 MBytes
[ 5] 9.00-10.00 sec 104 MBytes 870 Mbits/sec 0 3.48 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 1022 MBytes 857 Mbits/sec 0 sender
[ 5] 0.00-10.03 sec 1022 MBytes 854 Mbits/sec receiver
iperf Done.
Connecting to host merckx.vesarius.net, port 55202
Reverse mode, remote host merckx.vesarius.net is sending
[ 5] local 130.39.190.4 port 52580 connected to 104.176.81.55 port 55202
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 27.3 MBytes 229 Mbits/sec
[ 5] 1.00-2.00 sec 89.2 MBytes 748 Mbits/sec
[ 5] 2.00-3.00 sec 93.0 MBytes 781 Mbits/sec
[ 5] 3.00-4.00 sec 93.1 MBytes 781 Mbits/sec
[ 5] 4.00-5.00 sec 93.5 MBytes 784 Mbits/sec
[ 5] 5.00-6.00 sec 93.8 MBytes 786 Mbits/sec
[ 5] 6.00-7.00 sec 93.2 MBytes 782 Mbits/sec
[ 5] 7.00-8.00 sec 93.4 MBytes 783 Mbits/sec
[ 5] 8.00-9.00 sec 93.4 MBytes 784 Mbits/sec
[ 5] 9.00-10.00 sec 93.5 MBytes 784 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.03 sec 866 MBytes 724 Mbits/sec 0 sender
[ 5] 0.00-10.00 sec 863 MBytes 724 Mbits/sec receiver
iperf Done.
Connecting to host localhost, port 45201
[ 5] local 127.0.0.1 port 36060 connected to 127.0.0.1 port 45201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 72.5 MBytes 608 Mbits/sec 4 4.37 MBytes
[ 5] 1.00-2.00 sec 63.8 MBytes 535 Mbits/sec 8 4.37 MBytes
[ 5] 2.00-3.00 sec 63.8 MBytes 535 Mbits/sec 5 4.37 MBytes
[ 5] 3.00-4.00 sec 63.8 MBytes 535 Mbits/sec 2 4.37 MBytes
[ 5] 4.00-5.00 sec 63.8 MBytes 535 Mbits/sec 2 4.37 MBytes
[ 5] 5.00-6.00 sec 62.5 MBytes 524 Mbits/sec 6 4.37 MBytes
[ 5] 6.00-7.00 sec 63.8 MBytes 535 Mbits/sec 13 4.37 MBytes
[ 5] 7.00-8.00 sec 63.8 MBytes 535 Mbits/sec 2 4.37 MBytes
[ 5] 8.00-9.00 sec 63.8 MBytes 535 Mbits/sec 0 4.37 MBytes
[ 5] 9.00-10.00 sec 65.0 MBytes 545 Mbits/sec 0 4.37 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 646 MBytes 542 Mbits/sec 42 sender
[ 5] 0.00-10.03 sec 637 MBytes 533 Mbits/sec receiver
iperf Done.
Connecting to host localhost, port 45201
Reverse mode, remote host localhost is sending
[ 5] local 127.0.0.1 port 44686 connected to 127.0.0.1 port 45201
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 54.0 MBytes 453 Mbits/sec
[ 5] 1.00-2.00 sec 64.0 MBytes 537 Mbits/sec
[ 5] 2.00-3.00 sec 63.9 MBytes 536 Mbits/sec
[ 5] 3.00-4.00 sec 63.9 MBytes 536 Mbits/sec
[ 5] 4.00-5.00 sec 63.6 MBytes 534 Mbits/sec
[ 5] 5.00-6.00 sec 63.2 MBytes 531 Mbits/sec
[ 5] 6.00-7.00 sec 63.4 MBytes 532 Mbits/sec
[ 5] 7.00-8.00 sec 63.5 MBytes 532 Mbits/sec
[ 5] 8.00-9.00 sec 63.4 MBytes 532 Mbits/sec
[ 5] 9.00-10.00 sec 63.6 MBytes 533 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.04 sec 638 MBytes 533 Mbits/sec 2 sender
[ 5] 0.00-10.00 sec 626 MBytes 526 Mbits/sec receiver
iperf Done.
Connecting to host merckxw, port 5201
[ 5] local 10.0.17.2 port 51338 connected to 10.0.17.1 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 69.5 MBytes 583 Mbits/sec 0 3.22 MBytes
[ 5] 1.00-2.00 sec 88.8 MBytes 744 Mbits/sec 0 3.22 MBytes
[ 5] 2.00-3.00 sec 90.0 MBytes 755 Mbits/sec 0 3.22 MBytes
[ 5] 3.00-4.00 sec 88.8 MBytes 744 Mbits/sec 0 3.22 MBytes
[ 5] 4.00-5.00 sec 88.8 MBytes 744 Mbits/sec 0 3.22 MBytes
[ 5] 5.00-6.00 sec 90.0 MBytes 755 Mbits/sec 0 3.22 MBytes
[ 5] 6.00-7.00 sec 88.8 MBytes 744 Mbits/sec 0 3.22 MBytes
[ 5] 7.00-8.00 sec 88.8 MBytes 744 Mbits/sec 0 3.22 MBytes
[ 5] 8.00-9.00 sec 82.5 MBytes 692 Mbits/sec 1 2.32 MBytes
[ 5] 9.00-10.00 sec 77.5 MBytes 650 Mbits/sec 0 2.53 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 853 MBytes 716 Mbits/sec 1 sender
[ 5] 0.00-10.03 sec 853 MBytes 713 Mbits/sec receiver
iperf Done.
Connecting to host merckxw, port 5201
Reverse mode, remote host merckxw is sending
[ 5] local 10.0.17.2 port 45546 connected to 10.0.17.1 port 5201
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 16.1 MBytes 135 Mbits/sec
[ 5] 1.00-2.00 sec 70.3 MBytes 590 Mbits/sec
[ 5] 2.00-3.00 sec 89.5 MBytes 751 Mbits/sec
[ 5] 3.00-4.00 sec 90.9 MBytes 763 Mbits/sec
[ 5] 4.00-5.00 sec 90.6 MBytes 760 Mbits/sec
[ 5] 5.00-6.00 sec 88.7 MBytes 744 Mbits/sec
[ 5] 6.00-7.00 sec 89.7 MBytes 752 Mbits/sec
[ 5] 7.00-8.00 sec 91.9 MBytes 771 Mbits/sec
[ 5] 8.00-9.00 sec 91.9 MBytes 771 Mbits/sec
[ 5] 9.00-10.00 sec 88.5 MBytes 742 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.03 sec 811 MBytes 678 Mbits/sec 0 sender
[ 5] 0.00-10.00 sec 808 MBytes 678 Mbits/sec receiver
iperf Done.
The next step in the performance question is at the os and application layer.
Hint -- there are horrors ahead.
Cheers,
Jon.


