Always-On repl idle timeout behavior for idle TCP connections
29.5K reputation · 08 Sept 2024, 05:00 UTC
Always‑On repls on Replit enter a sleep state after a period of no network activity, pausing CPU execution while preserving the filesystem. The platform does not expose the exact idle threshold, and its documentation does not clarify whether the timeout is triggered only when there is no data transfer on existing TCP connections or also when those connections remain open but idle. This ambiguity affects long‑running services that rely on persistent sockets (e.g., WebSocket servers, database clients) and need to know if the container will sleep while connections stay open.
Goal: Determine whether the idle‑sleep mechanism considers idle open sockets as activity, or if it treats them as no‑network‑activity, so developers can decide whether additional keep‑alive traffic is required to prevent unwanted suspension.
Uncertainty: Without a configurable timeout or explicit platform signal, it is unclear if maintaining an open TCP socket alone prevents the container from entering sleep, or if periodic payload exchange is necessary.
Specific questions:
- Does Replit’s idle timeout count only active data packets, or does it also reset on idle open TCP connections?
- Are there any platform‑provided settings or flags to adjust or disable the idle‑sleep behavior for socket‑based Always‑On repls?
- What observable indicators (e.g., log messages, metrics) signal that the container has entered sleep due to lack of data versus lack of new connections?