firestack icon indicating copy to clipboard operation
firestack copied to clipboard

v055t: slow upload & download Wireguard speeds

Open luciahk1 opened this issue 4 months ago • 12 comments

Hi, I have internet speed 500 With rethink DNS version n on wireguard the speed is 300 which is very good. With rethink DNS version q on wireguard the is 70 - 80. I think this is big difference

luciahk1 avatar Aug 17 '25 07:08 luciahk1

Sounds concerning. How are you testing bandwidth, speed.cloudflare.com, or speedtest.net, or fast.com, or fiber.google.com/speedtest, or ...?

ignoramous avatar Aug 19 '25 15:08 ignoramous

Speedtest and fast.com

luciahk1 avatar Aug 19 '25 16:08 luciahk1

Speed improved on r version. Thank you

luciahk1 avatar Aug 21 '25 08:08 luciahk1

What's speed you notice in v055r?

ignoramous avatar Aug 21 '25 13:08 ignoramous

Now it is 140

luciahk1 avatar Aug 21 '25 16:08 luciahk1

The slowdowns seem related to excessive logging. Have you changed Configure-> Settings -> Log level to anything other than Info? Error will print fewer app logs with Very verbose printing the most.

ignoramous avatar Aug 21 '25 17:08 ignoramous

I put the log to off and now speed is 200 It is good

luciahk1 avatar Aug 22 '25 05:08 luciahk1

Another user writes,

Log level is in info.

Just did a fresh speed-test (variability is expected - t' version used for Rethink):

  • Native: 247 D - 143 UP

  • ProtonVPN app with Netshield: 248 D - 118 UP

  • Rethink app with Wireguard and firewall: 137 D - 18 UP

On the n' version both download and upload speeds were almost half of the native ones. After that I went straight to t'. Didn't try q'.

ignoramous avatar Aug 24 '25 18:08 ignoramous

I tested rethink v055m, rethink v055n, rethink v055t and com.wireguard.android 1.0.20231018 today. rethink v055m :

$ ./iperf3.17.1 -c 10.64.0.5 -t 5                                                
Connecting to host 10.64.0.5, port 5201
[  5] local 10.111.222.1 port 40936 connected to 10.64.0.5 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  70.2 MBytes   589 Mbits/sec   27    491 KBytes       
[  5]   1.00-2.00   sec  76.2 MBytes   640 Mbits/sec    0    570 KBytes       
[  5]   2.00-3.00   sec  75.1 MBytes   631 Mbits/sec    0    640 KBytes       
[  5]   3.00-4.00   sec  72.2 MBytes   606 Mbits/sec    1    525 KBytes       
[  5]   4.00-5.00   sec  61.4 MBytes   514 Mbits/sec    0    582 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec   355 MBytes   596 Mbits/sec   28             sender
[  5]   0.00-5.02   sec   348 MBytes   582 Mbits/sec                  receiver

iperf Done.
$  ./iperf3.17.1 -c 10.64.0.5 -t 5 -R                                             
Connecting to host 10.64.0.5, port 5201
Reverse mode, remote host 10.64.0.5 is sending
[  5] local 10.111.222.1 port 47794 connected to 10.64.0.5 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  67.9 MBytes   569 Mbits/sec                  
[  5]   1.00-2.00   sec  70.8 MBytes   593 Mbits/sec                  
[  5]   2.00-3.00   sec  68.8 MBytes   577 Mbits/sec                  
[  5]   3.00-4.00   sec  50.5 MBytes   423 Mbits/sec                  
[  5]   4.00-5.00   sec  65.5 MBytes   550 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec   328 MBytes   550 Mbits/sec  18811             sender
[  5]   0.00-5.00   sec   324 MBytes   543 Mbits/sec                  receiver

iperf Done.

rethink v055n :

$ ./iperf3.17.1 -c 10.64.0.5 -t 5                                                
Connecting to host 10.64.0.5, port 5201
[  5] local 10.111.222.1 port 36484 connected to 10.64.0.5 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  51.6 MBytes   433 Mbits/sec   14    470 KBytes       
[  5]   1.00-2.00   sec  43.5 MBytes   365 Mbits/sec    0    523 KBytes       
[  5]   2.00-3.00   sec  48.2 MBytes   405 Mbits/sec    0    575 KBytes       
[  5]   3.00-4.00   sec  54.0 MBytes   453 Mbits/sec    0    621 KBytes       
[  5]   4.00-5.00   sec  43.8 MBytes   367 Mbits/sec    4    470 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec   241 MBytes   404 Mbits/sec   18             sender
[  5]   0.00-5.01   sec   236 MBytes   396 Mbits/sec                  receiver

iperf Done.
$ ./iperf3.17.1 -c 10.64.0.5 -t 5 -R                                             
Connecting to host 10.64.0.5, port 5201
Reverse mode, remote host 10.64.0.5 is sending
[  5] local 10.111.222.1 port 41710 connected to 10.64.0.5 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  63.1 MBytes   529 Mbits/sec                  
[  5]   1.00-2.00   sec  65.0 MBytes   545 Mbits/sec                  
[  5]   2.00-3.00   sec  53.9 MBytes   452 Mbits/sec                  
[  5]   3.00-4.00   sec  63.6 MBytes   534 Mbits/sec                  
[  5]   4.00-5.00   sec  64.0 MBytes   537 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec   314 MBytes   526 Mbits/sec  16677             sender
[  5]   0.00-5.00   sec   310 MBytes   519 Mbits/sec                  receiver

iperf Done.

rethink v055t :

$ ./iperf3.17.1 -c 10.64.0.5 -t 5          
Connecting to host 10.64.0.5, port 5201
[  5] local 10.111.222.1 port 40606 connected to 10.64.0.5 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  56.5 MBytes   474 Mbits/sec   57    377 KBytes       
[  5]   1.00-2.00   sec  51.0 MBytes   428 Mbits/sec    0    433 KBytes       
[  5]   2.00-3.00   sec  41.8 MBytes   350 Mbits/sec    0    468 KBytes       
[  5]   3.00-4.00   sec  34.0 MBytes   285 Mbits/sec    3    251 KBytes       
[  5]   4.00-5.00   sec  40.8 MBytes   342 Mbits/sec    0    318 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec   224 MBytes   376 Mbits/sec   60             sender
[  5]   0.00-5.01   sec   218 MBytes   366 Mbits/sec                  receiver

iperf Done.
$ ./iperf3.17.1 -c 10.64.0.5 -t 5 -R                                             
Connecting to host 10.64.0.5, port 5201
Reverse mode, remote host 10.64.0.5 is sending
[  5] local 10.111.222.1 port 55428 connected to 10.64.0.5 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  35.0 MBytes   293 Mbits/sec                  
[  5]   1.00-2.00   sec  39.5 MBytes   331 Mbits/sec                  
[  5]   2.00-3.00   sec  44.2 MBytes   371 Mbits/sec                  
[  5]   3.00-4.00   sec  27.2 MBytes   229 Mbits/sec                  
[  5]   4.00-5.00   sec  30.2 MBytes   254 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.01   sec   183 MBytes   306 Mbits/sec  6398             sender
[  5]   0.00-5.00   sec   176 MBytes   296 Mbits/sec                  receiver

iperf Done.

com.wireguard.android 1.0.20231018 :

$ ./iperf3.17.1 -c 10.64.0.5 -t 5                                                
Connecting to host 10.64.0.5, port 5201
[  5] local 10.64.0.6 port 57510 connected to 10.64.0.5 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   132 MBytes  1.10 Gbits/sec  485    713 KBytes       
[  5]   1.00-2.00   sec   137 MBytes  1.15 Gbits/sec    0    840 KBytes       
[  5]   2.00-3.00   sec   133 MBytes  1.11 Gbits/sec    0    948 KBytes       
[  5]   3.00-4.00   sec   135 MBytes  1.13 Gbits/sec    0   1.02 MBytes       
[  5]   4.00-5.00   sec   135 MBytes  1.14 Gbits/sec    0   1.11 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec   672 MBytes  1.13 Gbits/sec  485             sender
[  5]   0.00-5.01   sec   666 MBytes  1.12 Gbits/sec                  receiver

iperf Done.
$ ./iperf3.17.1 -c 10.64.0.5 -t 5 -R                                             
Connecting to host 10.64.0.5, port 5201
Reverse mode, remote host 10.64.0.5 is sending
[  5] local 10.64.0.6 port 38846 connected to 10.64.0.5 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec   106 MBytes   886 Mbits/sec                  
[  5]   1.00-2.00   sec  99.8 MBytes   836 Mbits/sec                  
[  5]   2.00-3.00   sec   119 MBytes   998 Mbits/sec                  
[  5]   3.00-4.00   sec   106 MBytes   889 Mbits/sec                  
[  5]   4.00-5.00   sec   111 MBytes   928 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec   544 MBytes   913 Mbits/sec  39416             sender
[  5]   0.00-5.00   sec   541 MBytes   907 Mbits/sec                  receiver

iperf Done.

Lanius-collaris avatar Oct 16 '25 10:10 Lanius-collaris

Thanks. In v055t, is Configure -> Settings -> Log level set to Warn or Error or higher?

com.wireguard.android 1.0.20231018

$ ./iperf3.17.1 -c 10.64.0.5 -t 5                                                
Connecting to host 10.64.0.5, port 5201
[  5] local 10.64.0.6 port 57510 connected to 10.64.0.5 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
- [  5]   0.00-1.00   sec   132 MBytes  1.10 Gbits/sec  485    713 KBytes       
- [  5]   1.00-2.00   sec   137 MBytes  1.15 Gbits/sec    0    840 KBytes       
- [  5]   2.00-3.00   sec   133 MBytes  1.11 Gbits/sec    0    948 KBytes     
...

Oof.

I attempted to pull in Tailscale's code for GSO/GRO on the TUN device + netstack and on (WireGuard) egress UDP, but the changes are very involved.

ignoramous avatar Oct 16 '25 14:10 ignoramous

Thanks. In v055t, is Configure -> Settings -> Log level set to Warn or Error or higher?

I set Configure -> Settings -> Log level to None.

I attempted to pull in Tailscale's code for GSO/GRO on the TUN device + netstack and on (WireGuard) egress UDP, but the changes are very involved.

com.wireguard.android 1.0.20231018 even doesn't use UDP GSO/GRO. https://git.zx2c4.com/wireguard-android/tree/tunnel/tools/libwg-go/go.mod?h=1.0.20231018

module golang.zx2c4.com/wireguard/android

go 1.20

require (
	golang.org/x/sys v0.6.0
	golang.zx2c4.com/wireguard v0.0.0-20230223181233-21636207a675
)

https://git.zx2c4.com/wireguard-go/tree/conn/bind_linux.go?h=0.0.20230223&id=21636207a6756120f56f836b06c086b627f7b911#n248 https://git.zx2c4.com/wireguard-go/tree/conn/bind_linux.go?h=0.0.20230223&id=21636207a6756120f56f836b06c086b627f7b911#n226

Lanius-collaris avatar Oct 16 '25 22:10 Lanius-collaris

😭After checking produced .pcap files, I found that previous download throughput of rethink was invalid, because the server sent very large TCP segments which are larger than the MTU of the wireguard device periodically. Maybe the kernel implementation did something wrong.

Lanius-collaris avatar Oct 24 '25 02:10 Lanius-collaris