3 ms·
The author’s assertion isn’t correct though. Yes, technically speaking a PHP script that isn’t being executed isn’t itself costing you money. But it’s stored o
by afavour 2y ago
The author’s assertion isn’t correct though.
Yes, technically speaking a PHP script that isn’t being executed isn’t itself costing you money. But it’s stored on server that is running 24/7 and is costing you money.
Set up in the traditional way, CGI/PHP is priced by server uptime, be that per hour, per day, per month, whatever. The server runs all the time, it waits for requests, it processes them.
By contrast Lambda only costs money while your code runs. There’s a big difference there. Pricing of the two is different enough that a Lambda isn’t automatically cheaper but it’s misleading to suggest it’s just a CGI/PHP script. And we haven’t even started on the differences around scaling etc.
- magicalhippo 2y agoSo it's like code-only shared hosting, billed by CPU-time rather than wall-time, and with a load balancer in front.
- afavour 2y agoAnd it scales to multiple servers to accommodate traffic without your input. But essentially, yes. Not to sound uncharitable but I’m confused by statements like the OPs who profess to not understanding what Lambda is… it’s not actually that complex!
- jimbokun 2y agoDidn't know enough about it to know whether I should care enough about it to investigate more.
- salawat 2y agoAnd mind the opportunity cost: You never learn how to set such a thing up yourself; and AWS runs off to the bank. Where you could have had an asset, (frequently a good idea), that you can do something with. Remember, the innovation of cloud was to add a payment, IAM, and config layer on top of basic compute tasks.
- chubot 2y agoThere's nothing stopping anyone from implementing a cloud that runs CGI or FastCGI that scales down to zero (with per second billing), and scales up to infinity. It's just that nobody has chosen to do so Though I suppose not without reason. Google App Engine was one of the first "PaaS", billed on a fine-grained level, and it WAS initially based on CGI. Later they changed it to in-process WSGI, probably because working around CGI startup time is difficult / fiddly, and FastCGI has its own flaws and complexity. I think it would have been better if they had developed some of the open standards like SCGI and FastCGI though. I think it could have made App Engine a more appealing product Comments on Scripting, CGI, and FastCGI - https://www.oilshell.org/blog/2024/06/cgi.html https://www.oilshell.org/blog/2024/06/cgi.html
- crabmusket 2y ago> There's nothing stopping anyone from implementing a cloud that runs CGI or FastCGI that scales down to zero (with per second billing), and scales up to infinity. It's just that nobody has chosen to do so I think in discussions like this it's often helpful to think of Lambda not as a technology but as a product. Lambda isn't "CGI with extra steps", it's "CGI with per second billing", which is a rarer offering.
- fernandopj 2y agoYou have to consider that AWS Lambda does have "cold start" - if your code wasn't run for about 10 minutes it isn't "hot" anymore and will have a penalty time cost to its first next request. This is not billable but it is a latency, explained here [1] [1] https://docs.aws.amazon.com/lambda/latest/operatorguide/execution-environments.html https://docs.aws.amazon.com/lambda/latest/operatorguide/exec...
- gumby 2y ago> By contrast Lambda only costs money while your code runs. There is no fee for uploading it, only a fee for executing? In that case could I upload a function that only disgorges a static payload? Then I could store a multi-GB file for free and just invoke it in order to download the data.
- icedchai 2y agoYou still get charged for data / bandwidth egress, of course. Either way, that multi-gig response wouldn't work. You'd discover lambda can only generate a 6 megabyte response! Lambda has all sorts of weird limitations: https://repost.aws/questions/QUjXEef9ezTTKpWqKRGk7FSg/limitation-api-gateway-lambda-with-querying https://repost.aws/questions/QUjXEef9ezTTKpWqKRGk7FSg/limita...
- tshaddox 2y agoI believe there is no usage fee for uploading functions, but there’s a size limit per function and an account-wide total storage quota on uploaded functions. https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-...