cost-optimizationdevopsfinopsplaybook

Reducing dev and test cloud spend without slowing engineers down

Non-production is typically 30 to 40 percent of a cloud bill and used for 30 percent of the hours. The savings are large and safe, but only if the changes do not add friction. Here is the playbook that cuts spend without cutting velocity.

The C3X Team··8 min read

Quick answer

Attack non-production in five moves. 1) Schedule environments off nights and weekends: removes about 70 percent of runtime, the single biggest lever. 2) Downsize instance families, dev rarely needs production SKUs: 30 to 50 percent of what remains. 3) Use Spot or preemptible capacity, which suits interruptible dev workloads and saves 60 to 90 percent. 4) Make environments ephemeral with a TTL so they expire instead of accumulating. 5) Shrink data, use a 1 percent sample rather than a production sized database copy. Combined, teams routinely take non-production from 35 percent of the bill to under 12 percent with no loss of engineering velocity.

Non-production is the easiest large saving in cloud because the constraint that blocks production optimisation, risk to customers, does not apply. The constraint that does apply is engineer time. A dev environment that takes fifteen minutes to wake up, or a staging database too small to reproduce a bug, costs far more in salary than it saves in compute. Every lever below is chosen to preserve that.

The five levers, ranked

LeverSaving on non-prodFriction risk
Off hours scheduling60 to 70%Low if wake is fast
Smaller instance families30 to 50%Low
Spot / preemptible capacity60 to 90% of computeMedium
Ephemeral environments with TTLEliminates accumulationLow
Data subsetting50 to 90% of storage and DBMedium

Lever 1: stop paying for 118 idle hours a week

A week has 168 hours. A team working 9 to 6 across one timezone uses about 45 of them. Running dev around the clock means paying for roughly 3.7 times the capacity you use. Schedule instances and node pools to stop at 8pm and start at 7am on weekdays and you remove about 70 percent of compute runtime. On $40,000 a month of non-production compute that is roughly $28,000 a month.

The friction risk is real and has one fix: make waking up fast and self service. A Slack command or a pipeline button that starts the environment in under two minutes removes every objection. Exempt CI runners and anything a nightly build needs. Note that stopped instances still bill their attached block storage, so scheduling saves compute only, which is why lever 5 matters. Details in scheduled scaling for dev environments.

Lever 2: dev does not need production SKUs

Environments are usually cloned from production, inheriting instance sizes chosen for production load. A dev stack on m5.2xlarge at $0.384 per hour serves one engineer as well on an m5.large at $0.096, a 75 percent cut. Databases are the same story: an RDS db.r5.2xlarge at roughly $0.96 per hour in staging is usually a db.t3.medium at $0.068 in disguise. Single AZ rather than multi AZ in non-production halves the database cost again. Set the sizes in the module defaults so new environments start small rather than being resized later.

Lever 3: interruptible capacity for interruptible work

Spot and preemptible instances save 60 to 90 percent against on demand and their one drawback, interruption with short notice, is exactly what non-production tolerates. Test runners, build agents, ephemeral environments, and batch jobs are ideal. Keep anything with an engineer actively attached to a debugging session on on demand, or use Spot with a fallback so an interruption re-provisions rather than blocks. The trade offs are in Spot versus on demand savings.

Lever 4: make environments expire by default

The worst non-production cost is the environment created for a feature that shipped in March and never deleted. Give every non-production stack a TTL tag at creation, default 7 days for preview environments and 30 days for team stacks, and run a daily job that destroys anything past its TTL unless an owner extends it. Per pull request preview environments that destroy on merge are the strongest form of this, because accumulation becomes structurally impossible rather than a cleanup task. Teams that make this change often find 20 to 30 percent of their non-production footprint was environments nobody could name an owner for.

Lever 5: stop copying the production database

A 4 TB production database cloned into three non-production environments is 12 TB of storage plus the instance class needed to hold it. On gp3 at $0.08 per GB-month that storage alone is about $960 a month before compute. A representative 1 to 5 percent sample, with referential integrity preserved and sensitive fields masked, usually reproduces the same bugs. The friction risk is genuine: if engineers cannot reproduce a production issue, they will ask for the full copy back. Keep one full sized environment available on demand for the cases that need it and run the rest on samples.

Putting a number on it

On a $500,000 a month cloud bill with 35 percent non-production, that is $175,000. Scheduling takes roughly $70,000 off the compute portion, downsizing another $25,000, Spot on runners and batch $15,000, TTL cleanup $20,000, and data subsetting $10,000 of storage. Landing near $55,000 a month means non-production falls from 35 percent of the bill to about 12 percent, a $120,000 a month reduction, with no production risk at any step.

Keeping it that way

Non-production spend regrows faster than production spend because the barrier to creating an environment is low by design. The durable control is a cost estimate on the pull request that creates the environment, so the person adding an m5.4xlarge to a dev module sees the monthly figure while they can still change it. Price every change against the resource catalog and pair it with the broader reduce cloud bill checklist.

FAQ

How much of a cloud bill is non-production?

Typically 30 to 40 percent, and it is genuinely used for around 45 of the 168 hours in a week. That gap is the opportunity: running development environments around the clock means paying for roughly 3.7 times the capacity anyone actually uses. Because customer risk does not apply, non-production is the largest safe saving available in most cloud accounts.

Does scheduling dev environments off hours slow engineers down?

Only if waking up is slow or requires a ticket. Make it self service, a Slack command or pipeline button that starts the environment in under two minutes, and the objection disappears. Exempt CI runners and anything a nightly build depends on. Stopping at 8pm and starting at 7am on weekdays removes about 70 percent of compute runtime.

Should dev environments use Spot instances?

For test runners, build agents, ephemeral environments, and batch jobs, yes. Spot and preemptible capacity saves 60 to 90 percent against on demand and the one drawback, interruption with short notice, is exactly what non-production tolerates. Keep environments with an engineer actively attached to a debugging session on on demand, or use Spot with automatic fallback so an interruption re-provisions.

How do I stop dev environments accumulating?

Give every non-production stack a TTL tag at creation, default 7 days for preview environments and 30 days for team stacks, then run a daily job that destroys anything past its TTL unless an owner extends it. Per pull request preview environments that destroy on merge are strongest, because accumulation becomes structurally impossible rather than a recurring cleanup task.

Can I use a smaller database in staging?

Usually yes. A 4 TB production database cloned into three non-production environments is 12 TB, about $960 a month on gp3 at $0.08 per GB-month before compute. A representative 1 to 5 percent sample with referential integrity preserved and sensitive fields masked reproduces most bugs. Keep one full sized environment available on demand for the cases that genuinely need production scale data.

How much can dev and test spend realistically fall?

From around 35 percent of the bill to under 12 percent. On a $500,000 a month bill, non-production at $175,000 typically falls to roughly $55,000 after scheduling, downsizing, Spot on runners, TTL cleanup, and data subsetting. That is about $120,000 a month with no production risk at any step, though it regrows quickly without a cost check on the pull requests that create environments.

What to do next

Keep non-production small by default. C3X prices the Terraform that creates environments against a live resource catalog. Start with the quickstart.

Try C3X on your own Terraform

Free and open source. No API key required. One command to install, one command to estimate.