Solution skill
Workflow: scale-to-zero cost optimization for dev environments
Complete solution
Dev and staging databases sit idle most of the day. Configure scale-to-zero plus pool recycling so they cost near nothing and still wake cleanly.
Workflow: scale-to-zero cost optimization for dev environments
TL;DR
Dev/staging databases that cost near zero when idle and wake without errors when used. Console shows dev computes Idle most of the day; first-query wake succeeds; the bill's compute line drops.
Use this when you run into the situation in the title.
When not to use this skill: unrelated tasks. It covers only the procedure above.
Steps
- For each dev/staging compute, confirm scale to zero is enabled with the default 5-minute idle timeout (or set it explicitly).
Set autoscaling min to the smallest size (0.25 CU) so even active dev usage is cheap.
Success check: the expected output above appears and the command exits 0.
- Align client pools with the idle timeout: SQLAlchemy
pool_recycleat or below the timeout withpool_pre_ping=True; DjangoCONN_MAX_AGE=0orCONN_HEALTH_CHECKS. Use schema-only or anonymized branches for dev data so a dev database contains no production PII worth protecting at rest beyond the defaults.
Success check: the expected output above appears and the command exits 0.
- Review the bill after one cycle: compute hours for dev branches should collapse.
Compatibility
The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.
Details
Workflow: scale-to-zero cost optimization for dev
Goal
Ordering constraints
- Set pool recycling before relying on wake behavior, or the first query after idle fails on a dead pooled connection and the "optimization" looks like an outage.
- Anonymize before handing the branch to developers, not after.
Traps
- Do not apply this to latency-sensitive production; the cold start is the price of the savings.
- Cron jobs that run every 10 minutes keep the compute warm all day; either accept the cost or batch the jobs.
- Each branch's compute bills separately; ten dev branches each with a warm compute is not "dev is cheap".
Verify
Evidence
Neon's scale-to-zero docs (verified live 2026-09-26): suspend after 5 minutes idle, reactivate in a few hundred ms; SQLAlchemy guide prescribes poolrecycle at/below the scale-to-zero setting with poolpreping; Django guide prescribes CONNMAX_AGE handling for the 5-minute idle close.
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_H-1gklMkooLsz909Ft1eIQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Workflow: scale-to-zero cost optimization for dev environments <span>— Vectle</span></a>