I'm in a small team developing a single-page application that relies heavily on low latency queries over WebSockets. The back-end runs on Node.js + Redis. It needs to support hundreds to thousands of simultaneous connections and requests need to be served under 50 - 100 ms (under good network conditions on the client side). We're fairly happy with our initial implementation of this part of the server, it is performing as expected.
We also need to serve lots of static files over HTTP. These requests are not time sensitive. Because of the large storage requirements, we would like to opt for an array of HDDs instead of SSDs for cost reasons.
Is there a risk of slow disk I/O degrading the performance of the rest of the Node.js application (the WebSocket part only using in-memory database) or is it going to strictly affect the HTTP / static file serving part of the server? As far as my understanding goes, Node.js with it's asynchronous nature would be well suited for this kind of situation because it would allow the WebSockets module to process queries normally while the HTTP module is waiting the disks to read/write?
Perhaps the large amount of "waiting to be served" HTTP requests can clog the server in some way (after all, they need to be stored somewhere and it's probably not free to poll if the read/write is available either) and we need to consider using either a separate Node.js process for serving static files or even a separate dedicated server altogether?
I can think of the following things:
- the "waiting to be served" HTTP request are going to be using up the limited amount of concurrent TCP connections available
- the "waiting to be served" HTTP requests are also going to use up some RAM
- system files should probably reside on a disk that is not going to be busy serving the static files
We can't test this scenario out in the real world just yet so I would be very thankful to hear from anyone with similar experiences. This could require us to rethink out architecture and that's something we would preferably discover sooner than later.