A
A
Alexey Lebedev2014-08-05 09:52:52
Computer networks
Alexey Lebedev, 2014-08-05 09:52:52

Web sockets and regular requests. What's faster?

Traditionally, I used ordinary Polling in my projects, not even Long.
But now many people are promoting web sockets, they say that they are better. Therefore, sometimes the idea arises to rewrite critical modules for web sockets. But, I haven't seen a convincing comparison yet.
I'd like to see a good comparison between web sockets and polling.
What information is interesting:
1) load on the server (but take into account the moments that sometimes synchronization is needed once a minute, and sometimes less than a second)
2) support (any opera mini is of interest)
3) reliability (packet and connection losses)
Someone Has anyone seen similar studies? With beautiful numbers and comments?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Entelis, 2014-08-05
@DmitriyEntelis

1. The simplest node.js script keeps ~100k open sockets at the same time.
By running a bunch of processes, you can keep a million on one weak server.
habrahabr.ru/post/123154
It is obvious that you cannot withstand such a load with simple requests.
Another plus - through the socket your client receives the update immediately Another
plus - through the socket you can organize a two-way exchange protocol, without unnecessary requests
2. You can check it yourself
sockets and if there are none, it works through long polling
3. In practice, there may be a connection break, especially on the mobile Internet.
It is necessary to be able to work with this + when restoring - to request what has changed with a regular request.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question