grpc-web icon indicating copy to clipboard operation
grpc-web copied to clipboard

Multiple server-side streaming calls hangs the browser

Open Name-X opened this issue 3 years ago • 3 comments

We have a web page where more than 1 grpc calls (server side streaming calls)will be made , and all these will be pending state until the server responds with one response at least. If the number of these calls increases to 8 or 10 ,and the server doesn't send any response , subsequent normal calls are also getting blocked , making the UI unresponsive. Is there any limitation on having number of server-side streaming calls from browser

Name-X avatar Jul 10 '21 12:07 Name-X

@stanley-cheung any comments on this ?

Name-X avatar Jul 12 '21 16:07 Name-X

If you are using Chrome or Firefox, you may be running into a limit on the number of open connections (see https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).

When not used over HTTP/2, SSE suffers from a limitation to the maximum number of open connections, which can be especially painful when opening multiple tabs, as the limit is per browser and is set to a very low number (6).

In the past when I've hit this issue I've worked around it by establishing a single connection and pushing all messages over it.

ryanpbrewster avatar Jul 14 '21 04:07 ryanpbrewster

@ryanpbrewster , I am using http/2 only , in browser console i can see the calls are made with http/2. Still I am facing this issue. In my use case , i can't have a single endpoint and push all messages over it . There will be different servers sending messages

Name-X avatar Jul 15 '21 09:07 Name-X