Why worker pools beat clustering for CPU-Heavy tasks on Node.js
Imagine you have a Nodejs server with endpoint that performs heavy CPU operations. By default your server runs on a single thread. This means it will freeze depending on the CPU load. If your server has other asynchronous endpoints, for example, to execute database operations, those endpoints would become unresponsive while the heavy load endpoint is processing. Our first idea is to create more threads, sending the heavy tasks to be processed in parallel by another CPU core. Once finished, we se
Comment
Sign in to join the discussion.
Loading comments…