autossh keepalives drop tunnels under upload congestion
Debugging mid-transfer "other side closed" errors on long-running autossh reverse tunnels carrying HTTP uploads.
autossh's typical defaults ServerAliveInterval=15 ServerAliveCountMax=2 give only 30s of keepalive tolerance. When the same upload pipe gets saturated (concurrent uploads through the same tunnel, or unrelated traffic from the same machine sharing the home upload link), SSH-protocol keepalives can't get acknowledged in time and the entire multiplexed SSH session is torn down — surfacing to the app as SocketError: other side closed or fetch failed mid-request, even though the remote server and the application are fine. Bump to ServerAliveInterval=60 ServerAliveCountMax=10 for ~10 minutes of tolerance, which survives realistic congestion windows.
When a long-running tunneled HTTP request fails with other side closed mid-stream, check the SSH keepalive settings before debugging application timeouts, remote server crashes, or HTTP-layer timeouts.