ngrok ↔ local dev server: WebSocket upgrade reliability under load
0 reputation · 12 Oct 2022, 10:29 UTC
Goal
Determine whether ngrok’s handling of WebSocket upgrades is the source of frame loss or latency spikes when the local development server receives more than 200 concurrent connections.
Constraints & Uncertainty
ngrok 3.x injects a TLS termination layer adding 5–15 ms per request. Its core runs a single‑threaded event loop, which may become a CPU bottleneck under high concurrency. HTTP/2 support is optional and can introduce head‑of‑line blocking if the backend does not fully support streams. The metrics endpoint (/metrics) reports active connections and error rates, but requires an authenticated key.
Questions
- Does ngrok drop WebSocket frames when more than 200 concurrent connections are established, even if the local server responds correctly?
- Is the single‑threaded event loop the limiting factor in round‑trip times observed during load tests?
- How does enabling HTTP/2 in ngrok affect latency and header overhead compared to an HTTP/1.1 baseline?