4 ms·
Yes I am aware of that and sure it can be used for export/import like I described. But it won't answer the second part of my question, about Deno not utilizing
by staticelf 5y ago
Yes I am aware of that and sure it can be used for export/import like I described. But it won't answer the second part of my question, about Deno not utilizing all cpu cores on a multicore machine?
If I use a web worker it will be for one specific thing and that thing only, not for the entire web request? Thus, if there is anything slowing down the request in form of CPU intensity, it will "kill" the application at least until the cpu intensive request completes.
Sometimes it's hard to know beforehand what users do for example and surprising things can happen. I have had the same issues with Meteor for example where users killed the app because they tried to upload something unexpected that crashed the app and them spamming the upload button kept it crashing after restarts. It was of course an error from my part but it could be avoided if Meteor did support the cluster module. I have also had the exact same issue when unexpected large datasets occurred by user input (not file uploads), the app got so slow it stopped answering requests from other sources. It was after that I discovered that pm2 can run any node app in a clustered mode, which was very nice.
But with that experience in my baggage, it am very hesitant to use Deno because of this reason. I can't host my app on a serverless platform because reasons and I am not sure I even want to even if I could.
- tehbeard 5y agoReally what your asking is a framework level query rather than what low level primitives the runtime provides. Demo itself won't use all the cores for some JS you just slap in, that's not how JS works (it'll use the same as v8, which will be one main thread for the JS to be processed in and potentially several helper threads for IO etc) If you want multi core you either build it yourself using the web workers or find a framework that does it for you.
- staticelf 5y agoSure ok, but I don't see how that is possible if it holds the port busy? You can't start two deno processes on the same port number.