nwtgck / go-piping-tunnel

Tunneling from anywhere via Piping Server
MIT License
20 stars 3 forks source link

Improve yamux performance #5

Closed JPEWdev closed 2 months ago

JPEWdev commented 3 years ago

Bumps up the buffer size when using yamux from 16 bytes to 4096 by default and adds an option for the user to specify a specific buffer size.

In local testing, bumping the buffer size from 16 bytes to 4096 improved the scp file copy speed from ~1MB/s to ~50MB/s, and doesn't seem to have any negative impact on interaction interactions.

nwtgck commented 3 years ago

Thanks.

any negative impact on interaction interactions

But I need to check by myself because as you mentioned above, it might affect interactions for real-time communication. I think it depends protocols.

Other flags use 16 for buffer. https://github.com/nwtgck/go-piping-tunnel/blob/cd805350680af3b1cc4a71ef657627fffcfba843/cmd/root.go#L34-L35

nwtgck commented 2 months ago

@JPEWdev Thanks. I changed 4096 bytes by default but some buffer sizes are still hard coded: https://github.com/nwtgck/go-piping-tunnel/commit/add2e220369ee8b36040b9c5de6ebd9755b54063