Created
November 22, 2016 03:12
-
-
Save rvaidya/c758950dde5b97577fb8978d3e0dac5d to your computer and use it in GitHub Desktop.
AWS Serverless pricing calculator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let jobsPerMinute = 60; | |
let lambdaMemory = 128; | |
let lambdaExecutionsPerJob = 3; | |
let averageJobRuntimeInMS = 1024; | |
let sqsMessageSizeInKB = 64; | |
let minutesPerMonth = 43800; | |
let hoursPerMonth = minutesPerMonth / 60; | |
let jobsPerHour = jobsPerMinute * 60; | |
let dynamoStrongReadsPerJob = 0; | |
let dynamoWeakReadsPerJob = 0; | |
let dynamoWritesPerJob = 1; | |
let neededDynamoReadCapacityUnits = (dynamoStrongReadsPerJob + dynamoWeakReadsPerJob / 2) * jobsPerHour / 180000 * 50; | |
let neededDynamoWriteCapacityUnits = dynamoWritesPerJob * jobsPerHour / 36000 * 10; | |
let dynamoPricePerMonth = 0.0065 * hoursPerMonth * (Math.max(neededDynamoReadCapacityUnits - 25, 0) + Math.max(neededDynamoWriteCapacityUnits - 25, 0)); | |
let sqsPricePerMonth = 0.4 / 1000000 * Math.max(jobsPerMinute * minutesPerMonth - 1000000, 0); | |
sqsPricePerMonth += sqsMessageSizeInKB * 0.09 | |
let lambdaRequestPricePerMonth = 0.2 / 1000000 * Math.max(jobsPerMinute * minutesPerMonth - 1000000, 0); | |
let lambdaRunPricePerMonth = 0.000000208 / lambdaMemory / 128 * averageJobRuntimeInMS / 100 * lambdaExecutionsPerJob * jobsPerMinute * minutesPerMonth; | |
let awsPricePerMonth = dynamoPricePerMonth + sqsPricePerMonth; | |
awsPricePerMonth += lambdaRequestPricePerMonth + lambdaRunPricePerMonth; | |
console.log(awsPricePerMonth); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment