Hi,
I'm running a Python service on Zeabur using a Hetzner Nürnberg server (K3s). My service maintains a persistent outbound WebSocket connection to Binance (wss://stream.binance.com:9443).
I'm experiencing disconnections every 7-8 minutes consistently with this error: sent 1011 (internal error) keepalive ping timeout; no close frame received
What I've already tried:
- Set
ping_interval=5on the WebSocket client (websockets library) - Set
ping_timeout=10 - Added
open_timeout=30 - Exponential backoff on reconnect
The ping fix reduced drops from every 3-5 minutes to every 7-8 minutes but did not eliminate them. This suggests the issue is at the K3s network layer, not the application layer.
My question: Is there a TCP idle timeout or keepalive policy configured at the K3s level for outbound connections on Hetzner servers? If so, can it be disabled or extended for persistent WebSocket connections?
My service requires a 24/7 stable outbound WebSocket connection. The reconnects are causing in-memory state to reset every 7-8 minutes which affects my application logic.
Thank you
Sonnet 4.6