Description
Currently, an open workspace page uses 2 server side event (SSE) connections. These connections remains open as long as the page is open.
Google Chrome only supports a maximum of 6 open connections per host.
Firefox also has a limit, but for whatever reason, the SSE endpoints fail on Firefox. So on firefox, we do not hit the concurrent connection limit.
You cannot reproduce this on https://dev.coder.com
because (for w/e reason), all requests uses HTTP2. So there must be some multiplexing/connection pooling going on by Chrome.
I also tested this through a cloudflare tunnel, which uses HTTP3 and also does not have the issue.
Reproducing
- To reproduce, you must be using HTTP 1.1 from Chrome.
- Open a running workspace page on 4 tabs
- Open on a fourth tab, and the web request will be stuck in "pending" forever.
Workaround
A current workaround is to use a reverse proxy in front of Coder that enables HTTP2. Or you can enable TLS on the Coder server (--tls-enable
). Golang serves HTTP2 on TLS servers by default.
Implementation Notes
The easiest solution would just be to support HTTP2 on non-TLS connections in Coder. We explicitly opt in for TLS serving here:
Line 1523 in 202f7f7
HTTP2 does not work over non-tls.
Solution suggestion is to implement something in the frontend to detect HTTP 1.1 vs HTTP2.0 and display a warning?