niwinz/django-sse

Max Connections

stephenstubbs opened this issue · 2 comments

I am having an issue running the example where everything works in the first 6 open pages but from the 7th onwards they become incredibly slow. I have tried running it with gevent and multiple workers and experience the same issue.

@crazyconoli a bit late after 9 month but i get in the same situation and leave my response for somebody else that can face the same problem.

The reason is because browser support limited connections to one domain. If you use persistent connections in few tabs you just goes over limit and your browser stop to make responses (queue them until get a free slot). I ended up with creation of few subdomains and connect to sse endpoint there while main domain kept without persistent connections. This way has a drawback - you can't have authorized sse connection. You will get requests from anonymous user as auth cookies won't be sent on subdomain from main domain.

This project is unmaintained. Sorry for inconvenience.