How does AWS GB-SEC works in lambda?
If I’m right, is this how it works:
- when A request is received, it measures the time to complete the request and size of the data sent,
converts it into GB and sec, multiplies, and thats the GB-SEC used in 1 request.
If thats correct,
So how does GB-SEC work in react, like how much will it use approx for each request?
If thats correct,
So how does GB-SEC work in react, like how much will it use approx for each request?
>Solution :
If you are referring to AWS Lambda pricing, GB-sec refers to how much RAM is allocated to the function, it is not directly related to request size, although the size of the request could certainly have an impact on how much RAM you will need to allocate to the function.
As you can see on the price table here the price is calculated in Memory (MB) per 1ms of time.
When you configure your Lambda function, you configure a RAM / Memory value. For example you may configure 1024MB (1GB) of RAM for your function. Each invocation of that function will then have 1GB of RAM allocated exclusively for the function’s use during that invocation. During that time no other customer of AWS can utilize that 1GB of RAM. You are reserving a physical resource for your function, during the time the function is executing. Amazon charges you for each millisecond that you have that reserved for one of your function’s invocations.
Imaging your function takes 100ms to complete an invocation, it is configured to use 1024MB of RAM, and you get two invocations simultaneously. In that scenario, you will be charged for:
1024MB * 100ms * 2 invocations
At the current rate of $0.0000000133 per 1ms for 1024MB of RAM for an ARM based Lambda function, that would be:
$0.0000000133 * 100 * 2 = $0.00000266
Of course that pricing only kicks in after you have gone over the 400,000 GB-seconds monthly free-tier usage on your AWS account.