Reputation: 3693
I am running an express.js server. When I send some load the cpu usage spikes to over 140%.
I understand that since the system I am running the server on has 4 cores so it can go upto 400% as well.
My question is:
Upvotes: 2
Views: 1653
Reputation: 2365
Although the node is a single-threaded model that efficiently works on a single thread to serve the requests. But, it's underlying IO model is multi-threaded. There are two libuv components that act during the process one is event-pool and the other one is thread-pool and this thread pool is allocated with blocking operations like file reading, database queries, and IO operations.
Upvotes: 2