This example of AWS Lambda pricing is taken directly from the AWS service pricing page, and additional details can be found on that page.
Lambda counts, as a request, each time it starts executing in response to an event notification or invocations call, including test invocations from the console. You are charged for the total number of requests across all your functions.
Duration is calculated from the time your code begins executing until it returns or otherwise terminates, rounded up to the nearest 100 ms. The price depends on the amount of memory you allocate to your function.
The following table shows the free tier seconds and the approximate price per 100 ms associated for different memory sizes:
Memory (MB) | Free tier seconds per month | Price per 100 ms ($) |
128 | 3,200,000 | 0.000000208 |
192 | 2,133,333 | 0.000000313 |
256 | 1,600,000 | 0.000000417 |
320 | 1,280,000 | 0.000000521 |
2,816 | 145,455 | 0.000004584 |
2,880 | 142,222 | 0.000004688 |
2,944 | 139,130 | 0.000004793 |
3,008 | 136,170 | 0.000004897 |
Pricing example 1:
If you allocated 512 MB of memory to your function, executed it 3 million times in one month, and it ran for 1 second each time, your charges would be calculated as follows:
- Monthly compute charges
- The monthly compute price is $0.00001667 per GB and the free tier provides 400,000 GB
- Total compute (seconds) = 3 million * (1s) = 3,000,000 seconds
- Total compute (GB) = 3,000,000 * 512 MB/1024 = 1,500,000 GB
- Total compute - free tier compute = Monthly billable compute GB
- 1,500,000 GB - 400,000 free tier GB = 1,100,000 GB
- Monthly compute charges = 1,100,000 * $0.00001667 = $18.34
- Monthly request charges
- The monthly request price is $0.20 per 1 million requests and the free tier provides 1M requests per month
- Total requests - free tier requests = monthly billable requests
- 3M requests - 1 million free tier requests = 2 million monthly billable requests
- Monthly request charges = 2 million * $0.2/M = $0.40
- Total monthly charges
- Total charges = compute charges + request charges = $18.34 + $0.40 = $18.74 per month
Example - Amazon DynamoDB pricing
This example of Amazon DynamoDB pricing is taken directly from the AWS pricing page, and additional details can be found on that page.
Unlike traditional NoSQL deployments that ask you to think about memory, CPU, and other system resources that could affect your throughput, DynamoDB simply asks you to specify the target utilization rate and minimum to maximum capacity that you want for your table. DynamoDB handles the provisioning of resources to achieve your target utilization of read and write capacity, and then auto-scales your capacity based on usage. Optionally, you can directly specify read and write capacity if you prefer to manually manage table throughput.
The following table summarizes key DynamoDB pricing concepts:
Resource type |
Details |
Monthly price |
Provisioned throughput (write) |
One write capacity unit (WCU) provides up to one write per second, enough for 2.5 million writes per month |
As low as $0.47 per WCU |
Provisioned throughput (read) |
One read capacity unit (RCU) provides up to two reads per second, enough for 5.2 million reads per month |
As low as $0.09 per RCU |
Indexed data storage |
DynamoDB charges an hourly rate per GB of disk space that your table consumes |
As low as $0.25 per GB |
Manual provisioning example: Assume that your application running in the US East (N. Virginia) region needs to perform 5 million writes and 5 million eventually consistent reads per day on a DynamoDB table, while storing 8 GB of data. For simplicity, assume that your workload is relatively constant throughout the day and your table items are no larger than 1 KB in size.
- Write capacity units (WCUs): 5 million writes per day equals 57.9 writes per second. One WCU can handle one write per second, so you need 58 WCUs. At $0.47 per WCU per month, 58 WCUs costs $27.26 per month.
- Read capacity units (RCUs): 5 million reads per day equals 57.9 reads per second. One RCU can handle two eventually consistent reads per second, so you need 29 RCUs. At $0.09 per RCU per month, 29 RCUs costs $2.61 per month.
- Data storage: Your table occupies 8 GB of storage. At $0.25 per GB per month, your table costs $2.00.
The total cost is $31.86 per month ($27.14 of write provisioned throughput, $2.71 of read provisioned throughput, and $2.00 of indexed data storage).