Hacker News new | ask | show | jobs
by maccard 971 days ago
> People using lambda functions are getting ripped off, they could just buy a couple of VPS.

A non-zero amount of our CICD pipelines are "perform API call with secret pulled from SSM/Secrets Manager". They happen 1-2 times per day and take less than a 5 seconds to run on each invocation. We currently have a burstable EC2 instance running 24/7 to handle these which costs us ~$5/mo. My napkin math says that this would cost us ~$0.01/month to run these as lambdas. More to the point though, we're limited in concurrency on these. It's pretty common that they all get triggered at the same time, it would be ideal if we could allow for an "unlimited" number of these to run. This sort of workload would be great to run for lambda functions, the engineering cost of implementing it just doesn't ever make sense.

If we paid someone $150/hour to spend half a day on it, right now our break even point is probably 5 years...

2 comments

Also, if you implement it as lambdas, your solution is now less portable. Your EC2 instance can probably be ported to something else easier than some lambda solution.
This is objectively false. In fact, it's the opposite of true. Lambda forces you to have a single entry point to your code that passes the details of a request to your application in a structured way. Wrap that in the http server of your choice in about fifty lines of code and you're done.

Or, you use something like Express inside Lambda with Serverless and adapting it to a long running server is literally just deleting the fifty lines of code that export your lambda handler. It couldn't be more simple.

Which is to say, you'll almost always have more trouble going from something else to Lambda and not the other way.

> Wrap that in the http server of your choice in about fifty lines of code and you're done. > Or, you use something like Express inside Lambda with Serverless and adapting it to a long running server is literally just deleting the fifty lines of code that export your lambda handler. It couldn't be more simple.

...which is all extra setup that you need to do compared to if you weren't using lambda, in which case you'd already be set up using something like express. To be fair, it doesn't like it'd be too much work to do the conversion. But it would still be extra work compared to say moving something running on express and deployed in a container to another VPS and/or container hosting provider which would likely require no application changes at all.

There are services that offer compatible APIs to Lambda, in which case there's also no effort.

You could be switching from an integrated http server to using WSGI, which is almost identical to the effort I described. Who cares about the twenty minutes of work? It's "less portable" in such a trivial way.

> This is objectively false. In fact, it's the opposite of true.

I apologize for the tangent but in your mind, is false sometimes but not always the opposite of true? Or is this just emphasis? (Genuinely asking, not being snarky.)

ETA: Thanks for clarifying.

Something being wrong does not mean it is the exact opposite of what is the truth.
That's for abstractions to take care of. If my CI platform offers a lambda runner instead of an ec2 integration, I would use it in a heartbeat.

Also, it's a 5 line shell script that already depends on 2 AWS services (SSM and IAM) that makes an API call to a third AWS service (S3). It's already locked to AWS

I'm guessing the original developer was only $50/hr with a cheap, non-scaling setup like that.
I wrote it. It was a 50 line packerfile with a shell script that installs buildkite, docker, and the AWS cli, and hasn't been touched in 2 years other than bumping version numbers.