Long poll — how to make thousands of connections open?

For Long poll requests need to make thousands of connections open. At the moment - 15K connections.
Got the address. It is necessary to keep 15K in the http long poll connections.
The question is what tools are best to use? What language? How it can be implemented? If someone has had experience of such volumes - also I would like to hear advice.
June 5th 19 at 22:02
3 answers
June 5th 19 at 22:04
Too General question, well, ancient technology, why not the sockets?

Has a fallback with the polling.
But the key is that the websocket channel in fact.
On a well-loaded 8 core server holds 4-5K connections normally. Chokes when you restart of course)
Communication almost only in one direction, without receiving data from clients.

Not very suitable for communication in two directions, mainly to the distribution server.
In the two sides sharing the load immediately jumps to the skies and hangs.

In General, GO to portray something you for example.
Small ad implementation in a single process and a single thread was holding 2-3K users. Again, logic not only authorization and validation for alerts.
If gash sharding or multipotent, but 4-8 cores it is possible to hold 15K+.

Well NodeJS has not been canceled.
But in fact I gonoralisation NodeJS worked sucks than GO about 2 times less able to keep online 1500-1700, in the same single process and thread as the Go.
The implementation in both cases was on the knee, the functionality is the same.
Here forgotten clarification requests outbound, but not inbound. And the choice in technology (add or websocket) no. - Rosendo_Hess commented on June 5th 19 at 22:07
, oooo, nicose clarification, it is generally to another steppe)

I would never have met.
Under websocket have clients on the same node and you can connect to the server, and add even XS.
Mostly with servers and clients are in the set, it is necessary to look for a specific implementation - bailee_Stant commented on June 5th 19 at 22:10
Alexander, 4-5k connections is very small - clearly Centrifugo can do more 50k compounds in the prod to node without a problem it should be. Maybe it's the specific nature of the load on Centrifugo in your case? You can try to understand what was going on - write in the gitter chat project (link in the README on github is) - nikita.Stracke commented on June 5th 19 at 22:13
the sudden support of a centrifuge?)
in my case, the load is generally essentially nothing, so Yes in General it's weird.
A simple count of people sitting on the page:
That's the "logic" work https://gist.github.com/S-anasol/5970d1834dcd0cded...
Many channels are created and you are prompted for the list of online users, but no other logic.

The server is really heavily loaded, where the video is encoded and tons of traffic on the site, so it may well be that the centrifuges are few resources in fact. - bailee_Stant commented on June 5th 19 at 22:16
well I sometimes look at the referrers on Github:) On such a superficial information is of course difficult to judge, but there is speculation that a lot of join/leave event is sent - in fact on every connection and reload the page the message eventually is sent to all – this can lead to a huge number of messages. Join/Leave events massturbate bad on channels with a large number of users. There is still not the best place to dig up further if you want to understand the real cause, you can explore in the Gitter chat. Here steps which can help to understand what is happening - https://github.com/centrifugal/centrifugo/wiki/Inv... - nikita.Stracke commented on June 5th 19 at 22:19
, unsubscribed under the gist, it seems there should be an alert.
In General, I have all the rules, no load. 5K(already 8K uniques/14k connections) is likely the maximum that I have seen and which worked without problems. - bailee_Stant commented on June 5th 19 at 22:22
June 5th 19 at 22:06
Here is my project https://github.com/CppComet/comet-server I wrote in C++
If you do everything in mind that many simultaneous connections only require memory. And that's relatively not a lot. Since you don't need to do a separate thread for each connection. It is much harder to process many queries. As it consumes CPU time.
So I made measurements at 64 000 compounds https://comet-server.com/wiki/doku.php/comet:load-...

If you have questions or desire to participate in the project write.
well, Yes, I have the connections not long polling and websocket but from the server's point of view it still as in fact it is not the tcp Protocol. - Rosendo_Hess commented on June 5th 19 at 22:09
June 5th 19 at 22:08
To service tens of thousands of simultaneously opened connections are well suited for asynchronous servers.
Frameworks for writing asynchronous servers are available for nearly every language. In Java Netty. Python - Twisted, Tornado or aiohttp. Node.js and Go all "written around" that function.

Find more questions by tags Web DevelopmentLong polling