angt / glorytun

Multipath UDP tunnel
BSD 2-Clause "Simplified" License
683 stars 105 forks source link

Performance is sub-optimal #70

Closed 0xgrm closed 4 years ago

0xgrm commented 4 years ago

Hi,

First, thanks a lot for this project. I use it in OpenMPTCProuter. It's a fantastic piece of software!

It works great but performance is sub-optimal compared to TCP on plain MPTCP with Shadowsocks, especially for latency. In my case, Glorytun is used mainly for a site-to-site Wireguard VPN and for ingress.

When I download or upload big files using the Glorytun paths, ping instantly spikes to timeout, and both links are not well aggregated. On TCP with Shadowsocks, there is very only a 3-5 ms latency variance and it almost maxes out both links, on download and upload.

Configuration :

Thanks again for all the hard work you've put on Glorytun. Hope we will something here.

angt commented 4 years ago

Hi, Here are some hints:

I hope the latency will be better with these modifications. If that doesn't help, please let me know :)

0xgrm commented 4 years ago

Thanks,

For information :

About your hints :

What value should I choose for txqueuelen for tun0 and rate fixed for WAN 2? Do I have to set a small txqueuelen on LAN interface too?

0xgrm commented 4 years ago

When I set rate fixed on the LTE path, which has better upload bandwidth but worse latency, ICMP packets are always sent through it, resulting in much worse latency.

When I set it back to auto, ICMP packets are sent through the cable connection as expected.

Also, regarding MTU, Glorytun sets it to 1450 on tun0. Both WAN have a MTU of 1500. In cake SQM, on tun0, do I have to set the overhead setting or can I leave it to 0?

angt commented 4 years ago

Did you setup cake on server side too ? In that case,txqlen should be small on both sides.

Do you use cake on all interfaces ? or only on tun0 ? I recommend cake only on tun0, the other interfaces should have a simple scheduler (or even noqueue). You can also use netem for latency compensation when the difference is too large and breaks the aggregation for TCP.

I never used overhead, I'm curious if it helps :)

angt commented 4 years ago

Closing, don't hesitate to reopen the issue if necessary.

ghost commented 3 years ago

Hello,

Fantastic software, I'm facing an issue with upload speed with two heteregenous links (outdoor WiFi + ADSL). ADSL: 11mbit D 700kbit U Wifi: 12mbit D 12mbit U

If I disable thet ADSL path, upload speed goes up to 11mbit, when enabled speed drops down to 2mbit. I measured latency on both links, theyre the same during upload (70ms), ADSL is only pulling 100kbit, while WiFi 1.8mbit. I tried dropping ADSL TX to tiny 10kbit, the total speed now went up to 11mbit, but since I'm relying on the fail over mechanism, ADSL at 10kbit is not usable. Is there a weighing parameter or tweaking that can be done? Oddly enough, using Glorytun with ADSL only results in 2 second ping on upload after few seconds, and the speed cycles 100kbit to 800kbit. I tried cake scheduler and limiting the speed down to 200kbit, did nothing. I'm going to try to connect the ADSL through another VPN (probably wireguard) into Glorytun as an endpoint to hopefully rule something out (ISP maybe?) . I should note that the WiFi ISP UDP packets are out of order according to wireshark, ADSL is not.

angt commented 3 years ago

Hello and happy new year!! 🥳

Yes, this problem is known and should be fixed in the next 0.4 release with the new dynamic rate detection algorithm. It's almost finished but, I'm sorry, I just don't have time to work on this right now as I'm very busy with other (more valuable :p) stuff. I hope to release the 0.4 in March.

ghost commented 3 years ago

Happy new year!!!

And no problem, I only thought I missed something, good luck and thanks!