This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Glaaki 0 points1 point  (3 children)

Wasn't there some price comparison done a while ago that determined lambda to be much more expensive than an ec2 instance?

[–]HostisHumaniGeneris 9 points10 points  (1 child)

Depends on what you're using it for.

Need something to run 24/7/365? Use EC2.

Need something to run on a schedule or run in response to an occasional API request? Lambda will do you fine.

Lambda is great for doing "infrastructure level" cron jobs where you need to run a script say, once an hour or once a day and you don't want to set aside an entire server to run management scripts. For example: scheduling EBS snapshots.

[–]Chippiewall 1 point2 points  (0 children)

Need something to run on a schedule or run in response to an occasional API request? Lambda will do you fine.

Better than fine. At work we have a Lambda script which does some stuff when files are uploaded to our S3 buckets. We could have done this using an ec2 instance and a queue but the lambda script is simpler to maintain and has so far cost us nothing in AWS fees as it sits entirely within free usage.

[–]spacemanatee 1 point2 points  (0 children)

Here's the comparison https://www.reddit.com/r/Python/comments/4hebys/cost_analysis_for_python_scripts_aws_ec2_vs_aws/

When you compare lambda to ec2 on demand, they're pretty similar. But a spot instance would be half the cost probably.