- Newest
- Most votes
- Most comments
Hi,
Are you using Python in your Lambda?
If yes, I suggest you to read this excellent post: https://medium.com/@jolodev/my-pain-with-serverless-and-aws-lambda-52278429ae33
It explains very well how your total size is not only your code by the standard packages deployed by Lambda runtime (as layers for some of them). It also explains how to avoid their deployment when you don't need them.
The size of those packages changes as they get updated to new versions. They may get smaller or bigger depending of the goals of the version (optimization vs new features). So, when they get bigger, the total size may exceed the limit imposed by Lambda version. And then you get the message that you report,
So, the advice is to configure your Lambda runtime with minimum packages so that you stay away from this limit.
Best,
Didier
Thanks for the response! This is a good tip but does not explain why deploying the exact same thing works normally and on some days doesn't. I am mainly using node.js and some small python functions that do not play a role in this issue.
The reason you're experiencing this issues is likely caused by your use of Lambda Layers. Per the Lambda Quotas documentation, the maximum unzipped size of a function - including all layers and/or custom runtimes - is 250MB. The number of bytes reported in the error message includes not just your ZIP file, but also the layers your function is using.
I suspect that whatever layers are being included alongside your function are changing between deployments, and the total size of your function and its layer and runtime dependencies is running close to the maximum size.
Relevant content
- Accepted Answerasked 2 years ago
- asked a year ago
- asked 10 months ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago
Are you using Lambda Layers as part of your function configuration?
Yes I am using multpile Lambda Layers for each function to reduce deployment size. Today is one of those days where deployment doesn't work. No changes made.
Are any of the version numbers of the referenced layers changing between deployments?