The Challenge
The platform ran on Google Cloud: two WordPress sites on virtual machines, a Python API on App Engine and a managed MySQL database, all set up by a previous developer. Nobody had owned the bill for a while. Daily spend had climbed from about S$14 a day in June to S$18 a day in August, and nobody could say why.
There was a cost plan from before we arrived, but it had never been checked against what was actually running. Several of its assumptions were wrong: services marked for migration had already moved, and charges were blamed on the wrong servers.
The Approach
Every change was checked against the account's own billing data and audit logs, before and after. Nothing was resized just because a dashboard suggested it.
- Right-sized two oversized virtual machines, after checking memory and swap history first so the sites would not fall over under load.
- Moved the API from App Engine to Cloud Run, which scales to zero when idle. It ran alongside the old version and was tested before it took over, with a one-command rollback kept ready.
- Cleared out waste: an idle static IP address, orphaned disk snapshots and 340 old App Engine versions.
- Tuned monitoring so metric volume fell back under Google's free allowance, keeping every metric type.
- Fixed the WordPress servers' memory setup, which had been starving the web and database processes.
What We Caught Along the Way
- Deploys were weeks from failing. Both App Engine apps sat at 200 of a hard 210-version limit. The cleanup brought them to 61 versions while keeping three months of rollback history.
- Database storage had no ceiling. Cloud SQL disks grow but never shrink, so one runaway import would have raised the bill for good. A sensible limit is now in place.
- A security gap that also costs money. A batch server reached the database over the public internet, which is why the database was open to every address. Fixing it closes the gap and removes a cost.
The Result
| Service (approx. S$ / month) | August | September | Change |
|---|---|---|---|
| Compute Engine | S$270 | S$164 | −39% |
| App Engine | S$63 | S$1 | −99% |
| Cloud Monitoring | S$11 | S$0 | −100% |
| Cloud SQL (not yet touched) | S$189 | S$186 | −2% |
| Total | S$545 | S$363 | −33% |
September, the first full month after the changes, came in a third lower than August, a saving of roughly S$2,200 a year. The figures come from the client's own Google Cloud billing reports, converted to Singapore dollars and rounded. The managed database was left for a later phase, so there is more to come.
Just as important, the client now knows what they are running, what it costs, and why.