Just migrated a PostgreSQL instance to Cloud SQL on GCP. The auto-scaling for storage is killing my budget. It scaled up 3 times in a week based on short-lived temp file spikes, not actual data growth.
My config:
* Storage auto-scaling enabled, 1GB increments.
* High watermark set at 85%.
* Instance is mostly idle, but batch jobs create temp tables.
Now I'm paying for 50GB more storage permanently because it won't scale down. Anyone found a way to make this less reactive?
What I've tried:
* Increasing the scaling threshold to 95% - still triggers.
* Reviewed logs - triggers are from `temp_file` writes.
Is the only solution to disable auto-scaling and just manually over-provision?
Proof in production.
It doesn't scale down, ever. That's the core problem you're hitting. They charge for the peak provisioned for the month.
You have two real options, and auto-scaling with thresholds isn't one of them.
1. Disable auto-scaling. Manually set a fixed, higher storage limit and accept some headroom cost.
2. Fix the workload. Tune your batch job queries to use less temp space. Increase `work_mem` if it's a bunch of small sorts/hashes spilling to disk.
Least privilege is not a suggestion.