Skip to content

Conversation

@rithikanarayan
Copy link
Contributor

@rithikanarayan rithikanarayan commented Oct 20, 2025

What does this PR do?

Applies strip --strip-unneeded to all .so files 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:1 on an ARM Python 3.12 lambda function.

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

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 {} \;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hGreat idea! I'm surprised we weren't already stripping all the binaries in site-packages. Good find.

@rithikanarayan rithikanarayan marked this pull request as ready for review October 28, 2025 20:31
@rithikanarayan rithikanarayan requested review from a team as code owners October 28, 2025 20:31
@rithikanarayan
Copy link
Contributor Author

/merge

@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codex bot commented Oct 30, 2025

View all feedbacks in Devflow UI.

2025-10-30 20:36:08 UTC ℹ️ Start processing command /merge


2025-10-30 20:36:12 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 1h (p90).


2025-10-30 22:36:53 UTCMergeQueue: The build pipeline has timeout

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.

@rithikanarayan
Copy link
Contributor Author

/merge

@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codex bot commented Oct 31, 2025

View all feedbacks in Devflow UI.

2025-10-31 13:16:11 UTC ℹ️ Start processing command /merge


2025-10-31 13:16:16 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 1h (p90).


2025-10-31 14:20:14 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit d2ca824 into main Oct 31, 2025
84 checks passed
@dd-mergequeue dd-mergequeue bot deleted the layer-size-reductions branch October 31, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants