3 ms·
> a global.CONTEXT object (which works because nodejs is single-threaded) If that's true, then it sounds to me like AWS Lambda is being grossly inefficient, ha
by mwcampbell 10y ago
> a global.CONTEXT object (which works because nodejs is single-threaded)
If that's true, then it sounds to me like AWS Lambda is being grossly inefficient, handling only one request at a time in a given Node.js process. Am I correct about that?
- deleted 10y ago[deleted]
- intrasight 10y agoLambda supports several other languages that presumably don't have node's single-thread restriction
- stretchwithme 10y agoI think it's kind of the whole point. The instance of the application exists to service one request and then goes away. How many instances there are scales with the number of requests. And if you have an unpredictable workload, that may be the most cost effective and responsive solution.
- dullgiulio 10y agoWell, if a server could take more than one request and also scale horizontally, that would be so much more efficient. I am sure it has been done before. /s
- hassy 10y agoAWS Lambda is basically CGI, but on a huge scale. It's an amazing tool for some tasks, but there's a lot of hype around it too.
- singlow 10y agoIt does re-use a process for multiple requests, unless it is idle for a period of time in which case it will shut down. You can actually skip your initialization code on multiple runs if it is outside the scope of the handler function.