Node.js · Senior · Question 16 of 75

Why should a server use a pool of worker threads instead of creating a new worker per request?

Explanation

Libraries like Piscina manage a pool and a task queue. Size the pool close to the number of available cores.

Further reading

Problem with a question

Node.js · Senior · question 16

Test yourself

Take the Node.js · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz