Open Smith4545 opened 1 year ago
Ok this is an interesting one.
The webapp tunnels sieve messages via a http websockets.
Regular sieve which (not tunneled via TCP) requires a server to keep a connection open for at least 30 minutes. Because there where issues in the past and this the actual keep alive is way lower. It is currently at 5 minutes. Which looks like a good compromise. Because keep alive messages are rather heavy weight and sieve implementation tend to get upset if you fall below a certain threshold.
So to be safe with nginx default setting you need to be reduced to less than 30 seconds. Would be technically possible but it horribly scales. And it would generate lots of unnecessary load on the sieve server.
As far as I understood the nginx documentation a websocket ping does not extend the read timeout. So using a lightweight websocket based keep alive does not help.
So this basically splits down into three tasks.
I had to read that three times, but what I got out of that for the moment is:
proxy_read_timeout
therefore can be reduced to something between 300 and 600 seconds (which is way better than my initial 7200s)I'm testing with 600s and it seems to work for now. Thank you for having a look into this!
Prerequisites
What happened?
This problem is explicitly related to the usage of nginx in conjunction with the WebApp! On editing any Sieve-script via the WebApp, after not doing anything for a while, the user can't save his changes anymore. This obviously shouldn't happen. No matter how long the user doesn't do anything, he should always be able to save his stuff.
The reason for this behaviour is, that nginx, by default, will close a connection to a proxied server after 60 seconds if the proxied server doesn't transmit any data in this timeframe.
The probable solutions to this problem are:
proxy_read_timeout 7200s;
(or a timeout > than how long the user needs to work on his scripts) in the stated location block in the WebApp's README.md.What did you expect to happen?
No matter how long the user doesn't do anything, he should always be able to save his stuff.
Logs and Traces
Which Version
dfeeac10cb5cf65b08b31360229053bcdae50174