jpillora / chisel

A fast TCP/UDP tunnel over HTTP
MIT License
12.86k stars 1.36k forks source link

Long distance / High latency link optimization #109

Open eliezedeck opened 5 years ago

eliezedeck commented 5 years ago

Hi, How would I optimize chisel to be fast on high-speed high-latency scenarios? Currently, it can't fully utilize the bandwidth. Thanks.

Behrouz-m commented 4 years ago

I have the same problem. chisel is very slow.

jpillora commented 4 years ago

This is common for all TCP in TCP connections. The solution is to use UDP, though this probably impossible with SSH as the underlying protocol. Switch to openvpn or something that uses UDP

On Tue, 22 Oct 2019 at 6:16 pm Behrouz.m notifications@github.com wrote:

I have the same problem. chisel is very slow.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jpillora/chisel/issues/109?email_source=notifications&email_token=AAE2X4354PBWWWY2YSKM76DQP2SEHA5CNFSM4ILSORD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB4YONI#issuecomment-544835381, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE2X4ZVF42GXGZSR6AD6ZTQP2SEHANCNFSM4ILSORDQ .

eliezedeck commented 4 years ago

I think it is more a buffering problem than a TCP-in-TCP. I'm well aware of the TCP over TCP problem, and I believe that is not the problem that I have.

On both sides, the context is already local TCP, which always result in fast performance and no latency, the issue is the HTTP tunnel itself. I tried to look where are the buffer settings, but I could not locate it.

Based on your response, I suppose you won't be able to help us here. So ...

@jpillora It would help in my debugging if you could show me in the source-code, where can I modify the buffers that are used by the HTTP connections.

jpillora commented 4 years ago

Ah yes, read/write buffer size is currently 1KB so definitely might help

The source is fairly easy to read:

eliezedeck commented 4 years ago

Thanks ... will check those this weekend.

jpillora commented 4 years ago

Great, please report back and if it helps, we can change the defaults, or make it configurable

cognifloyd commented 4 years ago

Exposing the buffer sizes as a tunable option would be great. Several of the places (global) I want to use chisel client have very different networks/ISPs, so being able to tune the buffer size could be very beneficial. If nothing else, making it tunable would allow for quickly testing a variety of buffer sizes to see if/when tuning it makes a difference.