node icon indicating copy to clipboard operation
node copied to clipboard

Support load balancing HTTP requests across worker threads

Open mcollina opened this issue 9 months ago • 9 comments

I think we can support load balancing HTTP requests across worker threads by leveraging the same mechanisms that allows Cluster to do it. If a libuv handle can cross processes, it definitely can cross threads.

I've tried to do it outside of core in https://github.com/mcollina/tbal, but unfortunately it does not work because it requires some mangling of libuv handles that is only possible from within core.

The idea is to allow worker threads to have an libuv IPC channel similar to child processes, so that they can exchange libuv handles through it.

This should be opt-in.

mcollina avatar May 20 '24 17:05 mcollina