Quick revision
The short answer
Browsers allow only about six concurrent HTTP/1.1 connections per host, and every tab's SSE stream holds one of them open forever, so after about six tabs nothing is left for page loads or API calls and requests queue behind the streams. Serving the site over HTTP/2 fixes it, because all requests and streams share one multiplexed connection; sharing a single stream between tabs or moving the stream to another hostname are alternatives.
What to remember
In this answer, we saw that the hang comes from the browser's limit of about six HTTP/1.1 connections per host: each SSE stream holds one open, so after six tabs every other request queues. Serving the site over HTTP/2 multiplexes all streams over one connection with around 100 concurrent streams, which fixes it. Sharing one stream across tabs with a SharedWorker or a leader tab and BroadcastChannel reduces the load further, a separate hostname only moves the limit, and every proxy on the path must speak HTTP/2 to the browser for the fix to reach users.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Browsers allow only about six concurrent HTTP/1.1 connections per host, and every tab's SSE stream holds one of them open forever, so after about six tabs nothing is left for page loads or API calls and requests queue behind the streams. Serving the site over HTTP/2 fixes it, because all requests and streams share one multiplexed connection; sharing a single stream between tabs or moving the stream to another hostname are alternatives.
Why this question is asked
This is a bug that looks like a server problem but lives entirely in the browser. The server is healthy, CPU is low, and yet users with many tabs see pages that never finish loading. Interviewers like it because it tests whether we understand the connection model of HTTP/1.1 and why HTTP/2 changed it. In this answer, we will recap how browsers limit connections, reproduce the hang step by step, fix it with HTTP/2, look at alternatives when HTTP/2 is not available, and check the proxies that can quietly undo the fix.
1A Quick Recap: Connections Per Host in HTTP/1.1
Over HTTP/1.1, one TCP connection carries one request at a time. To load pages faster, browsers open several connections to the same host in parallel, but they cap the number so a single site cannot overwhelm a server. In Chrome, Firefox and Safari, that cap is about six connections per host (more precisely, per origin and browser profile), shared by all tabs of that browser.
A server-sent events stream is one HTTP response that never ends. While it is open, the connection it uses is busy and cannot carry anything else. So every open EventSource takes one of the six connections for as long as the tab is open.
2Reproducing the Hang
Suppose the dashboard is served from dash.example.com over HTTP/1.1 and each tab opens new EventSource("/events"). We open tabs one by one and watch the connections.
| Connection | Used by | State |
|---|---|---|
| 1 to 6 | EventSource in tabs 1 to 6 | open for hours, never free |
| none left | tab 7 page load | queued in the browser |
| none left | fetch("/api/stats") from any tab | queued in the browser |
Notice that the problem is not tab 7 alone. Any tab that tries to call the API is now waiting in the same queue, which is why users report that buttons stop responding everywhere. The browser will only free a connection when one of the streams closes. In DevTools the stuck requests show a long Stalled or Queueing phase, and chrome://net-internals or the connection ID column confirms that six connections are all held by event-stream responses. That is the clue that separates this from a slow server, where the time would appear as Waiting for server response.
3Fix 1: Serve the Site Over HTTP/2
HTTP/2 multiplexes: one TCP connection carries many requests at the same time as independent streams. The browser opens a single connection to the host and runs every page load, API call and SSE stream over it. The limit is now the number of concurrent streams the server advertises (SETTINGS_MAX_CONCURRENT_STREAMS), which is typically around 100 and can be configured. Six SSE streams use 6 of those 100, and everything else keeps flowing.
HTTP/2 in browsers requires TLS, so the site must already be on HTTPS. In Spring Boot with an embedded server, server.http2.enabled=true turns it on when SSL is configured. More often TLS ends at a proxy or a load balancer, and that is where HTTP/2 to the browser must be enabled; the hop from the proxy to the Spring application can stay HTTP/1.1, as long as the proxy does not buffer the stream.
4When HTTP/2 Is Not Enough or Not Possible
Even with HTTP/2, opening one stream per tab is wasteful when every tab shows the same data. One alternative is to share a single stream between tabs. A SharedWorker can own one EventSource and pass events to all tabs of the site through message ports. Where SharedWorker is not available, tabs can elect a leader, for example with the Web Locks API, and the leader holds the stream and rebroadcasts events with a BroadcastChannel; if the leader tab closes, another tab takes the lock and opens the stream.
Another option is to serve the stream from a different hostname, such as events.example.com, because the six-connection limit applies per host. That buys time but only moves the limit: a user with seven tabs on the events host has the same problem there. It also adds a cross-origin setup with CORS and cookies, so I would treat it as a stopgap.
5Checking the Path, Not Just the Server
A common disappointment is to enable HTTP/2 on the application server and see no change. What matters is the protocol between the browser and the first hop that terminates TLS. If a CDN or a load balancer in front only speaks HTTP/1.1 to browsers, users still get six connections. So we check in DevTools that the Protocol column shows h2 for the page and for /events, check every proxy in the chain, and verify that none of them buffers the stream or applies a short response timeout, which would turn a working stream into a loop of reconnects.
6Follow-up questions
What would change if you used WebSockets instead?
A WebSocket is also one long-lived connection per tab, and over HTTP/1.1 the browser counts it separately from the six HTTP connections, with a much higher limit for WebSockets, so page loads would not starve. But WebSockets over HTTP/1.1 do not benefit from HTTP/2 multiplexing unless the server and proxies support extended CONNECT, so each tab still costs a TCP connection and server memory, and we must write our own reconnect logic. For a one-way dashboard feed, HTTP/2 plus SSE is the simpler fix.
Why does the browser not just open a seventh connection?
The cap protects servers and networks from a single client opening too many connections, and it is shared across all tabs of the same browser profile. Browsers do not make it configurable for pages, so the application has to live within it.
How would you prove the fix worked for users?
Record the negotiated protocol and the stalled time of API calls in real user monitoring, and compare before and after. After the fix, nextHopProtocol should be h2 and the queueing time for API calls should drop to near zero regardless of the number of open tabs.
7Conclusion
In this answer, we saw that the hang comes from the browser's limit of about six HTTP/1.1 connections per host: each SSE stream holds one open, so after six tabs every other request queues. Serving the site over HTTP/2 multiplexes all streams over one connection with around 100 concurrent streams, which fixes it. Sharing one stream across tabs with a SharedWorker or a leader tab and BroadcastChannel reduces the load further, a separate hostname only moves the limit, and every proxy on the path must speak HTTP/2 to the browser for the fix to reach users.
Open with
The server is fine; the browser is out of connections. Over HTTP/1.1, browsers allow about six concurrent connections per host, shared by every tab, and a server-sent events stream holds its connection open for as long as the tab is open.
Then, if they want more
So with six tabs, all six connections are taken by streams, and any new page load or API call in any tab just sits in the browser's queue. In DevTools you see those requests stalled, not waiting on the server.
The real fix is to serve the site over HTTP/2: requests become streams multiplexed over one connection, and the server usually allows around 100 concurrent streams, so six event streams are no problem.
That has to be enabled at whatever terminates TLS for the browser, the CDN or load balancer or NGINX, not only on the Spring app, and the proxy must not buffer the stream.
On top of that, I would share one stream between tabs, with a SharedWorker or a leader tab that rebroadcasts through BroadcastChannel, since every tab shows the same data. Serving the stream from a different hostname also works, but it just moves the limit to that host, so I see it as a stopgap.
About this answer
- Last updated
- 13 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "What is causing the hang, and how do you fix it?": https://scrivio-interview-library.netlify.app/architecture/load-balancing-networking/18444d0e03/