Skip to content

Deprecate keep_warm in favor of AWS-native cold start solutions#1452

Open
monkut wants to merge 2 commits intomasterfrom
deprecate-keep-warm
Open

Deprecate keep_warm in favor of AWS-native cold start solutions#1452
monkut wants to merge 2 commits intomasterfrom
deprecate-keep-warm

Conversation

@monkut
Copy link
Copy Markdown
Collaborator

@monkut monkut commented Apr 10, 2026

Summary

  • Change keep_warm default from true to false
  • Add deprecation warning during deploy/update/schedule when keep_warm is enabled
  • Add DeprecationWarning in keep_warm_callback handler
  • Update README documentation to mark keep_warm as deprecated

Context

Investigation in #1445 confirmed that keep_warm:

  • Does not reduce cold start duration — init times are identical (~1,050ms) with or without it
  • Only reduces cold start frequency by keeping one execution environment alive
  • Only keeps 1 environment warm — concurrent requests still hit full cold starts

AWS-native alternatives are superior:

  • SnapStart: 45-72% faster cold starts
  • Provisioned Concurrency: eliminates cold starts entirely

The feature remains functional for users who explicitly opt in. Full removal planned for a future major version.

Closes #1451

Test plan

  • New tests verify deprecation warning appears when keep_warm: true
  • New tests verify no warning when keep_warm: false
  • New tests verify keep_warm_callback emits DeprecationWarning
  • New tests verify default is now false
  • Pre-commit hooks pass (isort, black, flake8, mypy)
  • Existing test suite unaffected

storkwrangler and others added 2 commits April 10, 2026 17:07
…1451)

Change keep_warm default from true to false and add deprecation warnings.
Investigation in #1445 confirmed keep_warm does not reduce cold start
duration — only frequency for a single execution environment.
- Regenerate README TOC after renaming heading to "Keeping The Server Warm (Deprecated)"
- Add setUp/tearDown to TestKeepWarmDeprecation to set AWS_DEFAULT_REGION, matching pattern used by TestZappa class to avoid botocore NoRegionError in CI
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 74.692% (+0.04%) from 74.651% — deprecate-keep-warm into master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate keep_warm in favor of AWS-native cold start solutions

3 participants