ys928 / stab

一个简单的TCP隧道工具,可轻松将本地端口暴露给远程服务器。A simple TCP tunnel that exposes local ports to a remote server.
MIT License
6 stars 0 forks source link

Latency issue #2

Open Musixal opened 1 month ago

Musixal commented 1 month ago

I've tested this project recently. compare to the similar projects like FRP and Rathole the latency is relatively high, almost 2x. any idea how to reduce latency or any plan to improve it?

ys928 commented 1 month ago

How do you test it? I need to know more information to locate the problem.

Musixal commented 1 month ago

I run stab in "server" and "local" mode on two separate VPS, then using XRay core with a vless-tcp inbound to test the connection stability and latency. Doing same thing with rathole. The latency for establishing a new connection with stab is as twice as rathole and sometimes increases dramatically. In Rathole, a much higher tcp connection is established in "FIN-WAIT-2" state, and I think this might be the reason for the lower latency. Of course, a high number of connections requires more resources. It seems that the implementation of Mux with the improvement of latency has a better result if it is accompanied. Checking the rathole code implementation (e.g. defining the connection pool) will probably help you improve the project.

ys928 commented 1 month ago

As you said, if I wanted to reduce latency, I would need to define a connection pool, but doing so would increase the complexity of the project and be contrary to the current design, so I might not implement it anytime soon.

The original design reference for this project is not the rathole project, but the bore project.