I'm implementing a web server using nodejs which must serve a lot of concurrent requests. As nodejs processes the requests one by one, it keeps them in an internal queue (in libuv, I guess).
I also want to run my web server using cluster
module, so there will be one requests queue per worker.
Questions:
- If any worker dies, how can I retrieve its queued requests?
- How can I put retrieved requests into other workers' queues?
- Is there any API to access to alive workers' requests queue?
By No. 3 I want to keep queued requests somewhere such as Redis (if possible), so in case of server crash, failure or even hardware restart I can retrieve them.