Why it matters
Development and test databases are often copied from production with the same edition. Moving them to Enterprise cuts their compute cost with no change to size.How nOps finds it
nOps reads Cloud SQL Enterprise Plus billing for each instance. An instance is flagged when it has been billed for at least 14 days, was billed in the last 2 days, and its project id or instance name contains a non-production word (such as dev, test, staging or sandbox) and no production word. Instances where committed use discounts cover at least half of the vCPU and memory cost are left out. The saving is the vCPU and memory cost over the last 7 days, net of committed-use offsets, scaled to a month, times 1 minus the Enterprise to Enterprise Plus list price ratio (0.0413 / 0.05369 per vCPU-hour, about 23%). Storage is priced the same and the data cache is not counted. The saving must be at least $5 a month. Projects whose spend on the service is at least 90% paid by credits or promotions are left out.Before you start
Confirm the database does not need the Enterprise Plus SLA, data cache or near-zero-downtime maintenance.How to implement
- Confirm with the owner that this is a non-production database.
- If the instance uses the data cache, turn it off first.
- Pick an Enterprise machine type with the same vCPUs and memory.
- In a maintenance window, change the edition: in the console, open the instance, choose Edit and select Enterprise, or run
gcloud sql instances patch INSTANCE --edition=enterprise --tier=MACHINE_TYPE. - Update Terraform so the next deployment does not change it back.
Risks and considerations
- The edition change restarts the instance.
- Enterprise has a 99.95% SLA instead of 99.99%, no data cache and longer maintenance downtime.
- Not every database version and machine type is available on both editions, so check the target first.
- To roll back, change the edition back to Enterprise Plus.
FAQs
How does nOps decide an instance is non-production?
How does nOps decide an instance is non-production?
From words in the project id and instance name only, such as dev, test, staging or sandbox. Labels are not used for this recommendation.