简体   繁体   中英

What would suit my use case better streaming, long polling, SSE or websocket?

Firstly to give you an idea of the scale, let me tell you that my web server needs to handle requests from 10k users in parallel, each user sends up a post request. Now coming to each user's request, the processing of each request is a CPU intensive work, the entire response for each request may take few minutes to over an hour to generate. However we have to send out the response in tiny packets as soon as they are ready continuously for the next 1 hour. From users end there would not be any request in the meantime except the fact he may wish to terminate the entire process altogether. I am building such a system from scratch starting now in 2015, what should be the best choice for it at this point of time. Let me also mention here if it matters anyhow in making a decision that this system would eventually be integrated with a node.js website.

I am answering my questions from the little research I did on this, what I have figured out is, using SSE in form of EventSource APIs would suit my use case the most. Let me know if you have any concerns with that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM