Skip to content

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

Open
monkut wants to merge 2 commits into
masterfrom
deprecate-keep-warm
Open

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

Conversation

@monkut

@monkut monkut commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

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

@dennybiasiolli

dennybiasiolli commented May 29, 2026

Copy link
Copy Markdown
Contributor

Small change: what about removing the keep_warm key/value in example/zappa_settings.json?

diff --git a/example/zappa_settings.json b/example/zappa_settings.json
index 74c8f051..28b31f93 100644
--- a/example/zappa_settings.json
+++ b/example/zappa_settings.json
@@ -1,7 +1,6 @@
 {
     "dev_event": {
        "project_name": "dev_event_zappa_test_flask_app",
-       "keep_warm": false,
        "debug": true,
        "log_level": "DEBUG",
        "events": [{
@@ -20,7 +19,6 @@
     },
     "dev_api": {
        "project_name": "dev_api_zappa_test_flask_app",
-       "keep_warm": false,
        "debug": true,
        "log_level": "DEBUG",
        "aws_region": "us-west-2",

@github-actions

Copy link
Copy Markdown

Hi there! Unfortunately, this PR has not seen any activity for at least 90 days. If the PR is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.

@github-actions github-actions Bot added the no-activity [Bot] Closing soon if no new activity label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-activity [Bot] Closing soon if no new activity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate keep_warm in favor of AWS-native cold start solutions

4 participants