News for hackers. Stuff that matters.
Re:We 30x'd our Node parallelism by x86_64Ubuntu on Friday December 13, 2019 @11:56AM (#21783223)
What does happen with the 5th request.
Re:We 30x'd our Node parallelism by NathanKP on Friday December 13, 2019 @12:14PM (#21783395)
It waits in a queue in a background thread in the node.js http library until your code can execute to handle it. So if your code takes a long time before returning back to the event loop the request will just wait in that queue for a long time before the next opportunity for the event loop to execute code in response to the event.
Re:We 30x'd our Node parallelism by kevstev on Friday December 13, 2019 @12:12PM (#21783365)
It will get queued, until one of the 4 requests in front of it has its task, to return the file, complete.
Re:We 30x'd our Node parallelism by jwalton on Friday December 13, 2019 @08:31PM (#21787188)
Well... yes. If you're using `express.static()`, or if all five requests are getting different things from the disk. If you're using something that caches your static content in-memory, then the first request will use the thread pool to read that content, but the other four requests won't touch the thread pool - it's all async IO at that point, so it's all happening "concurrently" in a single thread, being multiplexed right here: https://github.com/libuv/libuv/blob/1ce6393a5780538ad8601cae...