Node.js · Senior · Question 13 of 75
When does increasing UV_THREADPOOL_SIZE actually help?
- 1When JavaScript code is CPU-bound
- 2When there are many slow HTTP requests to other services
- ✓Correct answer: When many concurrent
fs,dns.lookup,crypto.pbkdf2/scryptorzlibcalls queue up behind the default 4 threads
Explanation
Network sockets don't use the pool, and JavaScript always runs on the main thread. For CPU-bound JS, use worker threads.