Subscription connection limits and idle timeout handling in GraphQL over WebSocket
0 reputation · 11 Sept 2025, 16:26 UTC
Determine the sustainable concurrent subscription connection count for a GraphQL server before its connection pool is exhausted, considering variations in server implementation defaults and load‑balancer idle timeout policies.
Apollo Server v4, graphql‑yoga, and Hot Chocolate expose different WebSocket handshake and keep‑alive behaviors; the GraphQL spec does not define a heartbeat, and proxies such as AWS ALB or NGINX may close idle WebSocket connections after 30‑60 seconds without notification.
What is the recommended maximum concurrent WebSocket subscription connections for Apollo Server v4 with its default settings? How does the lack of a standardized heartbeat mechanism affect connection stability behind typical load balancers? Should applications implement application‑level ping/pong frames, and if so, what interval aligns with common proxy idle timeouts?