node-webworker | A WebWorkers implementation for NodeJS | Runtime Evironment library
kandi X-RAY | node-webworker Summary
kandi X-RAY | node-webworker Summary
node-webworkers is an implementation of the Web Workers API for node.js.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of node-webworker
node-webworker Key Features
node-webworker Examples and Code Snippets
Community Discussions
Trending Discussions on node-webworker
QUESTION
I think the question is pretty explicit. JavaScript is single threaded and NodeJS still achieves incredible performances. We could think obvious that multi-threading would take NodeJS performances further, but it might be wrong in some cases.
For example, I'm currently building a starter project using NextJS. I wonder if handling each request in a separate thread would be worth it.
Thank you!
...ANSWER
Answered 2018-Mar-12 at 11:39As far as I know in production mode nodeJs "usually" used as:
- nginx server (used as security layer and as HTTPS proxy)
- number of child NodeJs processes (amount === number of cores)
That means that all cores are used,
request is processed by single core,
server processes several requests at once
=== UPDATE ===
If you want to divide single request processing into several threads - then just remember that cross-process communication is expensive in NodeJS, and you need to delegate huge tasks to other threads/webworkers
If you see the need to split app into several threads - consider using microservices architecture, e.g. using http://senecajs.org/
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install node-webworker
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page