Explanation
Why the waste happens and who it affects.
Common sources are databases left behind after a migration, instances created for a test or proof of concept, and databases of applications that were retired while the database was kept just in case. Cloud SQL bills provisioned capacity, so an idle instance costs the same as a busy one of the same shape.
This is different from an instance that is in use but oversized. An idle instance does not need rightsizing, it needs to be stopped or deleted, and Google runs a separate Active Assist recommender for exactly this case.
Billing model
The pricing dimensions that drive this cost.
Rates vary by region and edition.
- vCPU and memory
- Billed per second while the activation policy is ALWAYS, whether or not the instance handles traffic; HA instances pay HA rates
- Provisioned storage
- SSD, HDD or Hyperdisk Balanced capacity billed per GiB-month of provisioned size, also while the instance is stopped
- IPv4 addresses while idle
- An hourly charge for the instance's IPv4 address when the instance is not running
- Backups
- Automated and on-demand backups billed per GiB of backup storage used
How to detect
4 checks to find it in your estate.
- Review the Cloud SQL idle instance recommender (google.cloudsql.instance.IdleRecommender, "Remove unused SQL instances") in Active Assist or with gcloud recommender recommendations list --recommender=google.cloudsql.instance.IdleRecommender; it evaluates primary instances older than 30 days over a 30-day window
- The recommender looks at CPU utilization, memory usage, disk operations and changes in disk utilization, and flags instances whose activity stays below its idle threshold; recommendations are regenerated every 24 hours and read replicas are not analyzed
- Confirm with connection metrics: cloudsql.googleapis.com/database/network/connections (MySQL and SQL Server) or database/postgresql/num_backends (PostgreSQL) staying at zero or at monitoring-only connections
- Check labels, project and owner to see whether the instance belongs to a retired application, a completed migration or a test environment
How to fix
4 ways to remove the waste.
- If the database is no longer needed, delete the instance and take a final backup at deletion (--enable-final-backup with --final-backup-ttl-days, 1 to 365 days); deleting an instance otherwise removes its automated and on-demand backups
- If it may be needed again soon, stop it by setting the activation policy to NEVER; this suspends vCPU and memory charges, but storage and IP address charges continue
- Disable deletion protection only after confirming ownership, and remove read replicas along with the primary
- Add owner and environment labels and review idle recommendations regularly so new idle instances are caught within a month
Documentation
Vendor references for pricing and configuration.