Salim Khan
Salim Khan

Reputation: 104

Is the AWS Lambda package size considered in memory allocated?

Consider my Lambda package size is 100 mb (unzipped) and on its invocation, it uses say x mb. So will I be charged for the memory slot w.r.t (x + 100) mb OR only x mb?

Upvotes: 1

Views: 780

Answers (2)

Shivang Agarwal
Shivang Agarwal

Reputation: 1923

You are charged based on the number of requests for your functions and the duration, the time it takes for your code to execute. However, memory size you choose for your Lambda functions changes per 100ms execution cost.

Charges also differ on the basis of region in which lamda is executing.

For example: for 100 MB memory (Comes under 128 MB option) in US EAST(Ohio) region it will charge you $0.000000208 per 100ms.

You can find the details here and cacluate your cost

About package size:

The maximum limit of the size of deployment package is 250 MB when uploaded via S3. However we can’t upload more than 50 MB package while uploading directly into lambda function.

If we consider a larger package size it may seriously affect lambda function’s cold start time. Consequently, the lambda function will take longer time to execute with larger package size.

Upvotes: 0

Shailendra
Shailendra

Reputation: 9102

The Lambda pricing does not depend upon the package size - rather it's the RAM (apart from the number of executions and duration)

In the AWS Lambda resource model, you choose the amount of memory you want for your function, and are allocated proportional CPU power and other resources. An increase in memory size triggers an equivalent increase in CPU available to your function

Upvotes: 1

Related Questions