ngrok ↔ local dev server: WebSocket upgrade reliability under load
0 reputation · 12 Oct 2022, 10:29 UTC
0 reputation · 12 Oct 2022, 10:29 UTC
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.
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.
33775 reputation · 12 Oct 2022, 20:17 UTC
Ngrok does not drop WebSocket frames solely because more than 200 concurrent connections are open; frame loss only occurs if its internal TCP buffers overflow.
k6 run script.js or wrk -t12 -c400 -d30s wss://<ngrok‑subdomain>.ngrok.io/ws) that opens >200 concurrent WebSocket connections./metrics) to watch for upgrade errors, rising error rates, or CPU saturation.Missing diagnostic detail: Please provide the ngrok CPU usage (or event‑loop latency) observed during the test; if the loop is saturated, the latency explanation is confirmed and you may need to upgrade to a ngrok plan with worker threads or shard connections across multiple tunnels.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.