Test environment costs: which servers to stop overnight

Picture a hypothetical test environment that nobody opens between 7 PM and 7 AM, yet it keeps running through those hours. Stopping it on a schedule can cut the compute part of its bill. Before you set one up, check which charges continue while it is stopped and what a restart loses.

Weekdays, 7 AM to 7 PMExample EC2 instance runningNights and weekendsInstance stopped, EBS volume and Elastic IP bill
Example week: the EBS volume and Elastic IP bill all 168 hours

Count the hours the environment is used

Take a hypothetical environment that testers use from 7 AM to 7 PM on weekdays. It is needed for 60 of the week's 168 hours and sits idle for the other 108, about 64 percent of the week. The Instance Scheduler on AWS solution overview gives its own example: for instances left running at full utilization and needed only during business hours, a schedule cuts weekly use from 168 hours to 50 and can save up to 70 percent on those instances. Neither percentage counts storage or the other charges covered further down. Our guide on when to move QA off AWS ahead of production cites the same AWS example.

Those savings assume on demand pricing. The EC2 User Guide page "How billing works with Reserved Instances" says Reserved Instances are billed for every clock hour during the term, regardless of whether an instance is running. Savings Plans work on a similar footing: the Savings Plans User Guide describes a plan as a commitment to a specified amount of compute power, measured per hour, for one or three years, and says Cost Explorer carries its performance reporting. If a commitment covers the test servers, we recommend reading that report before counting on any saving from a schedule.

Your own figure will differ, so pull it from records you already have. Login times and CI job history show when people actually touch an environment. A QA stack may see bursts on release days and nothing between cycles, and a demo environment may see activity only around meetings.

Sort environments by what they hold

For each environment, ask what breaks when it is off overnight and again over a weekend. In the hypothetical schedule above, the weekend gap runs 60 hours, from Friday 7 PM to Monday 7 AM. The table below is a suggested starting point for a typical set, and each row needs its owner's review.

EnvironmentSuggested scheduleCheck before the first stop
Shared development serverStop outside working hoursWhether anyone works from another time zone, and what scheduled jobs it runs
QA stack with an approved datasetStop between test cyclesThat no regression run or nightly import is in progress, and that the dataset survives a restart
Build agents and CI runnersStop outside build hoursHow long caches take to rebuild on the first morning job
Load test environmentStop between runsWhether cold caches change the first run's results compared with the baseline
Demo environmentStart before the first meetingThe reset steps that must finish before a prospect logs in
Support environment for one customer's versionDelete when the fix shipsThat the archived build can recreate it

What keeps costing while it is stopped

On AWS, the EC2 User Guide page "Amazon EC2 instance state changes" marks a stopped instance as not billed for instance usage, and says resources such as Amazon EBS volumes and Elastic IP addresses incur charges regardless of the instance's state. The EC2 page on Elastic IP addresses adds that you are charged for every Elastic IP address in your account, whether or not it is associated with an instance. For databases, the Amazon RDS guide to stopping a DB instance temporarily says a stopped one is not charged for DB instance hours, while provisioned storage, backup storage and the public IPv4 address of a publicly accessible database keep billing.

Shared network pieces bill by the hour too. The Elastic Load Balancing pricing page charges for each hour or partial hour an Application Load Balancer is running, and the Amazon VPC pricing page charges for each hour a NAT gateway is provisioned and available. Stopping the servers that use them leaves both charges in place.

Azure bills its two stopped states differently. Microsoft's page "States and billing status of Azure Virtual Machines" lists Stopped, also called Stopped (Allocated), as billed, and says that state can result from the PowerOff API operation or a shutdown invoked from inside the guest OS. The same page marks Deallocated as not billed for compute, with a note that disks and networking continue to incur charges. After the first scheduled stop, we recommend opening the portal and confirming the VM shows Stopped (Deallocated) before counting any saving. Our guide Why does my Azure bill keep going up? works through a trial VM left in the allocated state.

Before choosing a target, compare the compute and storage lines on last month's invoice. A nightly stop saves on compute, so an environment whose bill is mostly disk saves a small share of it however the schedule is set. How to read a cloud bill in ten minutes shows how to group a bill by service.

State that has to survive a stop

The EC2 User Guide page "Stop and start Amazon EC2 instances" says you can stop an instance if its root volume is an Amazon EBS volume, and warns that stopping erases the data on any instance store volumes. On a nightly schedule that erase happens every night, so keep nothing on instance store that a test needs the next morning. Microsoft's "Overview of Azure Disk Storage" gives a similar warning for the temporary disk: its data might be lost when you stop the VM.

The same EC2 page says a started instance is typically assigned a new public IPv4 address, and the EC2 page on instance IP addressing says AWS releases the public address when the instance stops. A partner allowlist or a test script that holds the old address can break the next morning. For a persistent public address, that addressing page points to an Elastic IP address, which keeps billing while the instance sits stopped. A DNS name helps only callers that look it up, and the same page warns that mapping an existing name to a new address through dynamic DNS can take up to 24 hours to propagate. On Azure, Microsoft's "Public IP addresses" page says Basic SKU public IPs were retired on September 30, 2025, and Basic was the only SKU that offered dynamic IPv4 allocation. Standard SKU public IPs use static allocation, which the page says keeps the address the same until the public IP resource is deleted, so a VM keeps its Standard public address whether it is Stopped (Allocated) or Stopped (Deallocated).

The Amazon RDS guide to stopping a DB instance covers what a database loses. RDS deletes any data stored in the instance's RAM, so expect the first queries after each start to run without a warm cache. It removes pending actions, including scheduled maintenance updates, except those for the option group or DB parameter group. A database left stopped for seven consecutive days starts again automatically, and its instance hours bill again once it runs. The same guide says you can't stop a DB instance that has a read replica or is a read replica, and you can't stop RDS for SQL Server when it runs across more than one Availability Zone.

We recommend starting the database first and waiting until it is healthy before the application server starts, then running one health check that fails loudly. The RDS guide to starting a stopped DB instance says the startup can take minutes to hours, so time each database on its own.

Test the schedule on one environment first

We recommend a trial on the least important environment for a full week. Record how long each start takes, from the start command until a tester can log in, and note anything that failed. Start that environment ahead of its first user by the measured time plus a margin your team picks, and measure every other environment the same way before its schedule goes live.

The EC2 page on stopping and starting instances lists three services for automating it. Instance Scheduler on AWS carries additional charges, and its solution overview estimates USD 13.15 a month to run in the US East (N. Virginia) Region. A Lambda function with an EventBridge rule is the second, and Amazon EC2 Auto Scaling is the third, though the same page notes that Auto Scaling terminates unneeded instances instead of stopping them. The Auto Scaling guide to warm pools describes the exception: a warm pool can keep instances in a Stopped state, where you pay only for their volumes and attached Elastic IP addresses.

AWS Systems Manager also offers Resource Scheduler through Quick Setup. Its guide says Quick Setup has no cost of its own, though the resources it sets up can incur charges, and it stops and starts only the instances that carry a tag key and value you choose. The same guide says that if the attached EBS volumes are encrypted, the scheduler's IAM role needs permissions for the AWS KMS key before it can start the instance.

On Azure, Microsoft's Learn page on VM auto shutdown describes a setting on each VM that shuts it down during off hours, and its "Start/Stop VMs v2 overview" describes a feature that starts and stops VMs on schedules you define across subscriptions. Neither page says which stopped state the VM ends in, so check the power state after the first run, as described above.

Whichever tool you pick, keep a short exceptions list for nights when something must keep running, such as an overnight load test or a release freeze. Tag every environment with an owner and a schedule. The AWS Billing guide to cost allocation tags says tags must be activated before they appear in Cost Explorer or on a cost allocation report, and that they can take up to 24 hours to appear in the Billing and Cost Management console. Send any environment with no owner tag to the person who approves the bill.

When to delete rather than stop

A stopped environment still pays for its storage. If an environment can be rebuilt from an approved configuration, deleting it between uses ends its compute charges and the charges for the volumes you delete, and each use starts from that configuration. Resetting a QA environment between test runs describes rebuilding from an approved configuration.

Storage that a rebuild depends on keeps billing. Amazon's EBS pricing page bills Standard tier snapshots for the changed blocks they store, and the RDS guide to stopping a DB instance counts manual snapshots as backup storage. On EC2, the page on instance state changes says termination deletes the root volume by default and preserves any other EBS volumes. We recommend deleting those volumes too, once the environment's owner confirms nobody needs the data on them and any backup your team requires is in place. An Elastic IP address also stays allocated to your account until you release it, according to the EC2 page on Elastic IP addresses.

The clearest candidate is an environment that exists to reproduce one customer's bug, because its job ends when the fix ships. If your team has no archived build for an older release, the first job is keeping one, and Reproduce a customer bug on their exact version covers which releases to keep built and what to collect first.

Talk to a consultant