logo
cover

The Dark Side of Serverless: The Hidden Costs of AWS Lambda


Serverless Architecture is a great product, you can scale & cost efficiency in one time. But we have some new issues. What is? Yah your serverless hide some cost from you :)

What does Serverless Really Cost?

Not only pay as CPU and RAM, you will cost more than it. Let’s part it by 2 sections: The Visible Costs & The Hidden Costs.

The Visible Costs:

The Hidden Costs:

Let’s make assumption,

ComponentFormulaPrice%
Requests$0.2 x 1,000,000req / 1,000,000$0.23.27%
CPU & RAM$0.000016 x 512mb / 1024 x 100ms / 1000 x 1,000,000req$0.813.09%
Storage$0.000000037 x 512mb / 1024 x 100ms / 1000 x 1,000,000req$0.0020.03%
API Requests$4.25 x 1,000,000req / 1,000,000$4.2569.57%
Networking$0.09 x 1,000,000req * 10KB / 1024 / 1024$0.85814.04%
Total$6.11100%

Are you think Lambda is expensive? You can see the biggest cost is Network-Based.

Source Code Maintenance

The Paradigm on Serverless is 1 function for 1 worker. When you need a complex system for your apps, you need many functions. Serverless code = more lines of code.

Line of Code Comparison

Need someone to maintain it all. He/She needs to ensure everything working well. More lines of code = more complex to maintain.

Waiting for a Cold Start

When you need the lowest latency, maybe you can’t. Every Serverless provider has a cold start, just because they need to allocate your code into their instance. When your code optimizes to 1-digit millisecond, you can get more than 100ms for cold start only. Some providers have a solution to “provision” it, but the cost isn’t as cheap as their marketing.