APMSVLS-212 Reducing Python Lambda Layer Size#667
Conversation
Dockerfile
Outdated
| # benchmark uses pre-built wheels instead of building from sources. | ||
| RUN find ./python/lib/$runtime/site-packages/ddtrace -name "*.so" -exec strip -g {} \; | ||
| RUN find ./python/lib/$runtime/site-packages -name "*.so" -exec strip -g {} \; | ||
| # RUN find ./python/lib/$runtime/site-packages/ddtrace -name "*.so" -exec strip -g {} \; |
There was a problem hiding this comment.
hGreat idea! I'm surprised we weren't already stripping all the binaries in site-packages. Good find.
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
The merge request has been interrupted because the build 80812596 took longer than expected. The current limit for the base branch 'main' is 120 minutes. |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What does this PR do?
Applies
strip --strip-unneededto all.sofiles included in the Python lambda layer.Motivation
Frequent increases in Python lambda layer size, exceeding checks.
Stripping binaries further (originally only applied
strip --strip-debug) can reduce the unzipped layer size by about 2.5MB.Testing Guidelines
Ran serverless e2e tests and manually inspected traces on a Python sample app. Manually checked that profiling and appsec still produced appropriate output. Used layer
arn:aws:lambda:us-west-2:425362996713:layer:Python312-strip-unneeded-rithika:1on an ARM Python 3.12 lambda function.Additional Notes
Types of Changes
Check all that apply