Support for aws lambda #355
-
This is how it could work
|
Beta Was this translation helpful? Give feedback.
Replies: 10 comments
-
Maybe I'm missing something but isn't the point of AWS lambda to not need a server? Why would you want to shove already parsed requests into a server? |
Beta Was this translation helpful? Give feedback.
-
You're right. But to allow the code to work with any setup and maintain consistency, people usually prefer it. For eg. https://github.com/awslabs/aws-serverless-express |
Beta Was this translation helpful? Give feedback.
-
Lambda is for functions run after an event to do some work and then close down, maximum exec time of 15 minutes, it only receives the initial event so you are only serving that 1 request, its not for putting a server in there, what you should be doing is auto-scaling EC2 instances, did you try that yet @sachinmour? I think Elastic Beanstalk is what you are looking for EC2 auto-scale |
Beta Was this translation helpful? Give feedback.
-
@hst-m yes, i do know about Elastic Beanstalk and very much familiar with AWS infrastructures and i wouldn't use Elastic Beanstalk but much rather prefer Fargate if i had to.
I hope that made it clear for you. |
Beta Was this translation helpful? Give feedback.
-
Looks like Fargate does containers instead of full OS image. For Lambda yes that is how Lambda works, handles 1 event at a time, spins many for many events, so why are you trying to put a server inside a lambda function? Do you understand it makes no sense? Clears it up for you? |
Beta Was this translation helpful? Give feedback.
-
I'm not really sure how it doesn't make sense for you. |
Beta Was this translation helpful? Give feedback.
-
I do understand that the performance benefit that uWebSockets.js provides will all be pretty much lost inside lambda. This is a use case to increase adoption as people might wanna try it inside a lambda and see how it behaves and works before they jump on full board with it. This change will not give these users performance but a choice on how they use it. |
Beta Was this translation helpful? Give feedback.
-
Nobody should be using uWS.js inside Lambda at all because it is a bad idea and doesnt work as a server, it cant connect with clients so no way to send out websockets etc, it is easy to put uWS.js in EC2 instance, you are focused on Lambda for some reason but you should be using EC2 or containers you could try |
Beta Was this translation helpful? Give feedback.
-
You could use EC2 uWS.js server to call Lambda functions, but you should not be putting uWS.js inside Lambda, use it outside |
Beta Was this translation helpful? Give feedback.
-
Thank you for your thoughts @hst-m . |
Beta Was this translation helpful? Give feedback.
Nobody should be using uWS.js inside Lambda at all because it is a bad idea and doesnt work as a server, it cant connect with clients so no way to send out websockets etc, it is easy to put uWS.js in EC2 instance, you are focused on Lambda for some reason but you should be using EC2 or containers you could try