I’m in my late 30s and still have memories of the days when there was a clear difference between developers and system admins. As a developer, each time I needed a simple software environment set up on the development server, I had to call the IT admin and wait for him until he installed… a different version of one of the software packages I asked for! It took anywhere from two days to a whole week just to have a simple application server installed.

But things changed quickly. First, we had virtualization, then containers and now there’s serverless computing. You don’t have to worry anymore about the software environment, operating system, or hardware. As a developer, your only focus is the application and the time to market.

AWS Lambda uses a pay-per-use billing model, where you are billed only for the time your functions are running. The more your function runs, the more you pay. This model changes forever the relationship between application code and infrastructure costs. The hardware is automatically provisioned when needed and billed accordingly. There is no need to overprovision servers to cope with peak load.

As a result, traditional tools designed to monitor resource usage are of no practical use. Instead, it is necessary to track application level metrics like response time, memory utilization and batch size to control infrastructure costs. To put it in a few words, the infrastructure costs and application performance are strongly linked.

It might look straightforward but, there’s a big risk hidden here. Because AWS Lambda is very cheap to get started with, it lures developers to forget about the infrastructure costs during the development phase. At the end of the month, you will end up getting an unpleasant surprise in the form of a significant bill.

How AWS Lambda Pricing Works

For each Lambda function, you can set the maximum memory size and maximum function execution time. For the moment, keep in mind that the maximum memory size has an impact on the processing power (CPU) allocated. The more memory you provision, the more CPU your function gets.

Lambda functions run only when triggered and Amazon uses several indicators to calculate the cost of running your Lambda function:

  • number of executions
  • duration, rounded up to the nearest 100ms
  • memory size - the value set in the function configuration.

#aws #aws lambda

How to Optimize AWS Lambda Costs (With Examples)
1.10 GEEK