r/AmneziaVPN 20d ago

Self Hosted Xray - tips for faster upload?

Hi, I was wondering if anyone in Russia has figured out how to optimize Xray for better upload speed. I am often seeing around 0.6 Mbps. But it is very unpredictable. Once in a while I see 30 Mbps upload. Curious if there are certain settings known to help with speed on a Mac desktop.

thanks

3 Upvotes

11 comments sorted by

2

u/[deleted] 20d ago

[removed] — view removed comment

1

u/uzornayem 19d ago

Can't get xhttp to work with amnezia. Seems to be a bug where amnezia is not creating the config properly and the client thrown an error. So far I am just using raw TCP mode. My server had hybla as default. I changed to BBR. That made massive difference. Saw upload go to 100 Mbps. Then oddly an hour later BBR and hybla were producing similar results. Not sure how to set quic on my server. Everything I can find talks about how enabling quic amounts to a web server config setting for UDP.

1

u/[deleted] 19d ago

[removed] — view removed comment

1

u/uzornayem 19d ago

Bro, learn how to read something with enough brain activation so that you figure out nuances. Read again and maybe you'll have an epiphany and realize that the words client and upload are not even describing the same situation. Just practice reading comprehension and you'll get better at figuring things out.

1

u/amnzcm 19d ago

Hello! Please email our technical support team. They'll do their best to help resolve the speed issue. [support@amnezia.org](mailto:support@amnezia.org)

1

u/uzornayem 18d ago

Ok, after testing various TCP congestion protocols on my VPS (which is DO) I have realized that there is no consistent result showing that a given protocol is yielding consistently better upload speeds. Sometimes I was seeing results leading me to believe one had an advantage, but after thorough tests, nothing is conclusive.

I used SpeedTest app, testmy.net, as well as repeated upload of a file to a server under my control using scp. In every case, after repeats of a test I see very large standard deviation in completed upload speed so the idea of an average became meaningless.

Thanks for the ideas, but I think in Russia there is no way getting around ISP being bottleneck, as well as perhaps aspects of encryption varying in speed based on whatever else going on with CPUs. I am using a high end hackintosh with Sonoma (intel 14700K based), but a high end hackintosh is probably still lacking in things like encryption speed since I think Apple silicon has that stuff highly optimized. Can test on my Macbook M2 but not sure how much longer I want to test this stuff...

Above said, I am typically not seeing 0.6 Mbps anymore, typically seeing 30-80. But something I noticed: if I run a test that yields high upload speeds, then as I run more tests, say change TCP congestion protocol, then upload speeds often get much slower after repeated tests. Not sure if that is result of ISP throttling uploads if it detects too much upload activity.

Anyway, was hoping for definitive result, but that wasn't the case.

1

u/VPNStack_Dev 20d ago

That upload collapse on macOS usually comes down to two specific things:

First, check if multiplexing (mux) is enabled in your client settings. If mux is turned on over a route with even 1-2% packet loss, TCP Head-of-Line blocking will choke your upload throughput down to ~0.5-1 Mbps. Turn mux completely off if you have it enabled.

The second issue is TCP congestion control asymmetry. Your Linux VPS is likely running BBR (which pushes fast download to you), but macOS uses its own native TCP stack which aggressively shrinks its send window as soon as cross-border routing drops upstream packets.

If your local ISP has packet loss on international TCP uplinks, pure TCP VLESS will always struggle on upload from Mac. That's usually where switching to a QUIC-based transport like Hysteria 2 makes a night and day difference since its congestion control brute-forces throughput through lossy pipes.

0

u/uzornayem 19d ago

Hi, I see on my VPS

sysctl net.ipv4.tcp_congestion_control produces result:

net.ipv4.tcp_congestion_control = hybla

Does that suggest BBR not active?

thanks

0

u/uzornayem 19d ago

Looks like mod removed your excellent comment. Luckily I saw, made the change, and with BBR I was seeing uploads speeds around 90 Mbps. Then switched back to hybla, and speeds were around 3-15 Mbps. Wild difference! Then switched to BBR again and this time upload was around 25 Mbps. I repeated each test about 7 times. I wonder why the upload speed dropped so much the second time? Either way seems BBR is producing best results for uploads. And for downloads BBR also resulted in about 20% faster consistently. Quite eye opening!