-
Notifications
You must be signed in to change notification settings - Fork 747
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
Polling the homeserver, the app always times out after 60 seconds #2169
Comments
Just a question, if that bug would be fixed, would increasing the "Sync request timeout" help with high data usage (even though I am only in two DM it used 14MB for around 50 messages) or is this just an unfixable thing with the matrix protocol/synapses implementation? |
Well, that's only part of the story. With "Background Sync Mode" set to "Optimized for battery", I could observe different behaviour:
A and B each lead to a higher energy usage in mode "Optimized for battery" than in mode "Optimized for real time". I would have lost about 15% of the battery savings achieved as described above (#2169 (comment)), so I'll continue using "Optimized for real time". |
Hi ! Fighting with battery issue too, could you please post your nginx reverse proxy config ? |
Here's the standard part of the nginx reverse proxy config. "cheers.modular.im" is the DNS name of the real homeserver. Enabling HTTP-keep-alive to upstream is optional, it doesn't make a difference to the Matrix clients.
Here's a part of the reverse proxy config specific to making it work for Matrix. Apparently, the homeserver's real name is used somewhere in the returned content, making the client contact the real homeserver directly.
Here's the config to enable repetition of requests by the nginx reverse proxy on behalf of the clients, in two parts.
Keeping TCP connections from clients alive and usable for HTTP requests:
|
Looks like I missed a (non-significant) part of my nginx config: The log_format I'm using is a pimped version of "combined" that allows the operator to see the reuse of TCP connections for multiple requests by a client, duration of handling a request, the possibly more-than-one upstream responses for a client's single request, and compression efficiency. I'm using this format for various virtual hosts; $scheme, $host, and $upstream_cache_status are not related to the Matrix reverse proxying.
|
I am using Element installed from F-Droid. Version 1.0.7 brought along #2080. Setting "Sync request timeout" does make the app set the "&timeout" parameter in a background-polling request for "/_matrix/client/r0/sync" as expected. 👍
"Sync request timeout" apparently can be set to any integer value. (I like that. Given the option (and support by the homeserver for very-long-living requests), I'd probably set it to "infinite", so I'd have a permanent TCP connection to the homeserver.)
However, no matter the value of "Sync request timeout", the app gives up waiting for an answer after 60 seconds. It then closes the TCP connection, which is a very expensive operation, because the connection (and probably the SSL session, too) can't be reused for further requests.
Would it be possible to increase the app's internal timeout to something like "Sync request timeout + 10 seconds"?
The text was updated successfully, but these errors were encountered: