Skip to content

Conversation

sebsto
Copy link
Contributor

@sebsto sebsto commented Sep 26, 2025

All the examples using SAM have a default Lambda runtime environment memory size of 512Mb.

Lambda functions run in a microVM defined by its memory size. The memory size influences the CPU power.
(see https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html)

Increasing memory size increases runtime performance but also increase costs.

As most of our examples are very simple and small functions, 512Mb memory is not required. This PR reduces Lambda runtime execution environment to 128Mb to reduce AWS costs.

@sebsto sebsto added this to the 2.0 milestone Sep 26, 2025
@sebsto sebsto self-assigned this Sep 26, 2025
@sebsto sebsto added the 🔨 semver/patch No public API change. label Sep 26, 2025
@sebsto sebsto requested a review from 0xTim September 26, 2025 07:17
@sebsto sebsto linked an issue Sep 26, 2025 that may be closed by this pull request
@sebsto sebsto changed the title [examples] Use smaller containers in all examples [Example] Use smaller containers in all examples Sep 26, 2025
@sebsto sebsto merged commit 02d4830 into swift-server:main Sep 26, 2025
37 checks passed
@sebsto sebsto deleted the sebsto/memorysize branch September 26, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[examples] reduce size of container from 512Mb to 128Mb
2 participants