Disclaimer: This article is based, among other things, on the personal opinion of Amiram Shachar (CEO of Spotinst). The author's company offers a competing product called Spotinst Functions.
Translation is made by the cloud provider Cloud4Y . We offer software-configured data centers (vDC) based on VMware vSphere cluster solutions managed by the VMware vCloud Director self-service portal.
According to many experts, serverless computing is the next step in the evolution of computing systems architecture. The reasons for making this “jump” are clear:
- You save time : you no longer need to plan and think about how the amount of resources for the operation of the application will increase or decrease. Not only will you not have to deal with deployment after deployment, but you can also spend more time on further innovation, saving it at work with the infrastructure.
- You can save money : in a serverless world where you pay for a trigger, you do not need to write on / off scripts, schedule reservations, or predict bursts. You just pay for what you use .
Serverless - the next step')
As a transition from on-premises to the cloud, the transition to serverless is to some extent inevitable. However, having made this move, you may unexpectedly get a bill for a larger than expected amount.
The cost of serverless computing is more than pay-per-trigger
TimerCheck.io is a service built entirely on AWS Lambda and API Gateway by Eric Hammond (Eric Hammond, SVP Technology at CampusExplorer).
When working on AWS Lambda, the costs of the TimerCheck feature were incredibly low — only $ 0.22 for 2 million requests and 300,000+ seconds of calculations. Sounds much more profitable situation with the payment for the entire server when using only part of it, is not it?
So, but the fact is that the Lambda functions accounted for slightly less than 2% of its total AWS cloud value.

After that, Eric wrote an
AWS Lambda pricing article calling on Amazon to lower the cost of the API gateway.
“If you are reading this post after November 2016, the prices for these AWS services have certainly changed, and you should not use any of the above calculations when making decisions about working with AWS,” said Eric.
But, in fact, prices have not changed.
What are the real costs of serverless computing?
In fact, the cost of serverless is more than just the cost of CPU and RAM, and for many users the main cost factors will be additional cost categories such as API Requests, Storage and Networking.
5 cost categories for serverlessVisible costs
- Requests: these costs, as a rule, amount to about $ 0.2 per 1 million requests for the performance of a function throughout the market, for all providers.
- CPU & RAM: $ 0.000067 per GB / second - also quite standard
Hidden costs
- API Requests: Since many serverless applications are very heavy in API calls, this can be a fairly large item of expenses — about $ 3.50 per million requests.
- Network: If you are sending a lot of data, you need to carefully study this cost category. With a level of $ 0.05-0.09 per GB-out and 0.1-0.2 dollars between Virtual Private Clouds / regions on AWS, the cost of traffic can be very expensive. In general, network costs are usually the most difficult to track costs.
Unknown costs beforehand
Some of the cost of serverless is not always easy to measure in dollars and cents.
Support codeServerless coding = more lines of code. So Twin Tech Innovations noted: "For each non-trivial query processing route (part of the functionality) added to the program, the number of lines of configuration code needed to support the project grows with transcendental linear speed when using serverless architecture."
Line Code Comparison“Someone should support all this. Someone must ensure that there will be no problems, that changes are made to the configuration of only one function and will not be accidentally transferred to others. Someone has to make sure that the code is not duplicated, and the complexity and dependencies are manageable. ”
Cold bootWithout going into details, it is worth noting that the initial launch is the main reason why some
companies decided to abandon serverless when evaluating Lambda .
“100 milliseconds just to run ... while the user application needs a latency of less than fifty milliseconds,” said Hannah Taub.
These initial startup delays are likely to disappear in the end, but for now you have to take them into account.
How to analyze the cost of serverless architecture
Now we will carry out a cost analysis based on the basic components. Each of them has enough details for much deeper calculations, but we limit ourselves to this.
Consider the main differences in prices.The AWS Lambda feature with 512 MB of memory costs $ 0.030024. On-Demand server comparable in characteristics will cost from $ 0.0059. Therefore, if the processor is fully used all the time, work on the serverless architecture may be less efficient for such a workload.
Properly design API requestsAPI Gateway tends to be a significant part of your costs if you connect to a large number of APIs. The more API requests you make per trigger, the less savings you will see from switching to serverless.
Do not forget about trafficThe transition may be inappropriate if data / networking creates the bulk of the cost of the application.
Explore the offers of all serverless providersThere are several alternative offers on the market, each of which has its own unique advantages in pricing.
Cost comparisonEstimate the cost of additional support codeThink about how much time you or your team will have to spend on switching to serverless calculations.
Free tierAlmost every provider offers a level of free use, sometimes it is enough to run small workloads. If you want to be super economical, you can use them all together. If you design your serverless applications properly, this can be an excellent opportunity to gain independence from the provider. In addition to cost savings, it will also allow you to run functions with cloud providers that are most suitable for this particular workload.
Comparing Free TiersUltimately, the transition to serverless architecture can provide great potential in terms of cost and time savings. To avoid any surprises, it is worth spending time analyzing before fully diving into serverless.