How (if possible) to use node-cluster to schedule which worker will respond to a request, based on type of request e.g. one worker for write (POST/PUT/DELETE methods) and 1+ worker only for read (GET)?
This is common on Load Balancing databases, where master server is for Write, and slaves have a carbon copy of the master data and can serve much faster, with less CPU usage and better query cache.
On my NodeJS web service, I have a very fast read requests, even more faster with varnish cache, but with a small and constant amount of write requests, sometimes CPU intensive, lock entire thread by 0.1s~0.3s. In this case, even if I just spawn the node application with both READ/WRITE requests, I will still have the same problem, since each WRITE request will slow down all process. This is why I suppose use the same strategy as some databases could be a good idea.
So, on this type of load balancing (workers scheduling policy based on WRITE/READ request), is possible use node-cluster?
Att.
Emerson