-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to modify TCP Keep-Alive duration in Client (in the form of a battery life optimization setting) #108
Comments
you can build the framework by yourself |
Sure I can, but that won't fix high battery drain for all other users. |
Thanks for reporting that @ValdikSS. We've had significant issues in the past due to the server closing idle connections and the lack of a keep-alive. See Jigsaw-Code/outline-server#85 It's not clear what the values should be, and we need to figure that out. It seems we can tweak both the server and the client. My issue with the config is that no one except a few will have any idea what to do with it, so we will make the app more complex while not really helping the bulk of our user base. How can we address that? |
@fortuna, this issue is about TCP-level Keep-Alive in golang, not a software-level connection timeout found in shadowsocks-libev. All current golang applications which use |
We need more fined grained controls to adjust this. A longer initial interval, followed by quicker probes. ValdikSS has an issue reported on Go, which got fixed on Go 1.23. We can wait for Go 1.23 to add it to the server, or we can implement it ourselves with socket flags. We have already disabled Keep-Alives in the Client, which should help. |
shadowsocks/go-shadowsocks2#224
Since outline-ss-server is based on go-shadowsocks2, this issue applies to it as well.
Describe the bug
go-shadowsocks2 sends TCP Keep-Alive packets every 15 seconds, on every connected and listened TCP socket (shadowsocks server-client connections, outgoing connections to other servers), which leads to high battery usage on mobile devices.
Since keep-alive interval is set also on listening socket, non-go-shadowsocks2 clients will also receive keep-alive packets every 15 seconds when connecting to go-shadowsocks2 server.
More information here: golang/go#48622
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect Keep-Alive interval to be configurable.
go-shadowsocks2 should allow to increase TCP Keep-Alive or to disable it completely.
15 seconds is a golang default value and it's way too short. For comparison, Linux sets default keep-alive value to 2 hours (which is probably too high).
The text was updated successfully, but these errors were encountered: