Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
187 views
in Technique[技术] by (71.8m points)

java - How can I calculate "uncompressed" size for AWS Lambda?

I am trying to understand the deployment size limits for AWS Lambda as I encountered the following error after adding another layer to my Lambda function:

An error occurred: <function name> - Function code combined with layers exceeds the maximum allowed size of 262144000 bytes. The actual size is 269081659 bytes. (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: <request ID>; Proxy: null).

I understand that the total uncompressed size of code + layers cannot exceed 250 MiB but I cannot understand how my code and layers have breached that limit. I especially cannot make my layers add up to the 'actual size' stated in the error.

I am using the Java 8 runtime and my jar is 54 MiB. Unzipped it is 140 MiB. I had two existing layers with the following sizes:

Layer Compressed size Uncompressed size
Elasticsearch (jar) 22 MiB 54 MiB
ImageMagick 17 MiB 58 MiB

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...