5 ms·
yeah but you run into other issues when you put all of your lambdas on the same VPC
by aketchum 3y ago
yeah but you run into other issues when you put all of your lambdas on the same VPC
- nameless912 3y agoNot to be that guy, but why lambdas? I'm genuinely curious. I've never found the "cost savings" (big air quotes) worth it in comparison to the increased configuration/permissions complexity. Especially when Fargate exists, where you can just throw a docker container at AWS, what do Lambdas add? The zero scaling?
- sakopov 3y agoYour mileage may vary, but I think in majority of the cases Fargate is going to be significantly more expensive than Lambda.
- nameless912 3y agoBut at low request volumes, either is a rounding error to a medium size enterprise, and for personal projects IMO Lambda is a huge PITA.
- hooverd 3y ago/shill The AWS SAM CLI smooths over a lot of Lambda's rough points. /unshill
- nameless912 3y agoGasp, a shill?? I totally believe you, I just can't see how it becomes easier than chucking a container on Fargate or something. Maybe I've just been scarred by lambda rat's nests in the past.
- hooverd 3y agoYeah, the "proper" way to do Lambdas, shown in so many fancy architecture diagrams, is a rat's nest. I don't like APIs on Lambda unless you can shove them into one container with a catchall proxy on API Gateway. They really shine if you're processing SQS messages or EventBridge events. If you aren't using other AWS services and aren't cost engineering, then Lambdas probably aren't worth the headache.
- iends 3y agoThe serverless framework makes lambda for side projects a breeze. CDK for everything else.
- meowtimemania 3y agoOne of lambda's ideal use cases is personal projects. Personal projects usually serve very few requests so lambda's ability to scale to zero results in cost savings.
- cdelsolar 3y agoI don't think that's actually true on a GB-second basis (memory * CPU)?
- hooverd 3y agoThe cost efficiency of Lambda vs Fargate/EC2 ECS/one of the dozen other ways to run containers on AWS plummets as your RPS goes up.
- Olreich 3y agoLambda is the most expensive thing you can do if you have more than 25% utilization. Fargate is extremely close to modern on-demand EC2 pricing (m7a family).
- makestuff 3y agoYeah you can run Fargate on EC2 now as well to optimize cost even further.
- oarmstrong 3y agoFargate on EC2? Sorry you’ve lost me, I understood Fargate to be a layer of AWS managed compute for ECS or EKS deliberately instead of EC2.
- makestuff 3y agohttps://lumigo.io/blog/comparing-amazon-ecs-launch-types-ec2-vs-fargate/ https://lumigo.io/blog/comparing-amazon-ecs-launch-types-ec2... You can now specify your launch type to be an ec2 instance. This has the benefit of lower cost but you are responsible for managing the instances ex: security patches, etc.
- oarmstrong 3y agoRight, running ECS on EC2, not Fargate on EC2. When ECS launched it only had the EC2 launch type (where as you said you must manage your machines). Fargate then came along for both ECS and EKS where Amazon managed the machines for you.
- qvrjuec 3y agoWith CDK, I can get an ECS service up and running in the same amount of time it'd take to create a lambda function behind API gateway or triggered by SQS/cron. Deploys are easier, cost savings are real, permissions/configuration are the same level of complexity unless you're cutting corners. I'd only use ECS for stuff I know would be high sustained throughput, long duration(>15m) tasks, or things that absolutely need more persistence between executions.
- hooverd 3y agoServerless is great if you recognize that it's just somebody else's container runtime. I wish there was better tooling for Docker based Lambdas though. I hate whole S3 deployment dance for zip file based Lambdas (yes SAM does it for you now but it's still there). EC2-backed ECS has a great use case for things that you can run ephemerally in a container but require a persistent data store.
- Zanfa 3y agoWhy not? The setup I’m experimenting with for an API right now is basically a single Lambda that’s accessible through a function URL (so no ELB/ALB) + an RDS instance. Spinning up additional environments is a single Cloudformation call and deployment artifacts should work with both Docker containers or S3 (depending on the Lambda execution environment). Seems like a leaner setup than using ECS/Fargate + LBs to me. Have I overlooked something?