Google Cloud Run 在 6 周内花费了我 4676 美元,但没有任何流量。
5 分•作者: creativesage•6 个月前
尊敬的 HN 用户:
我是一个尚未有付费客户的独立开发者。在迭代一个副业项目时,我希望获得更可预测的基线成本,因此我从 App Engine 迁移到了 Cloud Run。
我将我的设置、预算和约束作为上下文输入到 Gemini CLI 中,让它搜索官方文档和最佳实践,并按照其指导进行操作。
我移除了 –min-instances=1,期望自动缩放能够减少闲置支出。提交信息声称“节省 60% 的成本”。实际结果是成本增加了大约 1800%,并且当我去用信用卡买咖啡时,收到了一个令人惊讶的余额不足的提示。
从 11 月 2 日到 12 月 14 日,Cloud Run 产生了大约 4676 美元的费用。期间没有流量高峰,没有滥用,也没有应用程序错误。这些服务大多处于闲置状态。
雪上加霜的是:CPU 和内存被过度配置(4 个 CPU,16Gi),这是早期实验的结果。每次部署都会创建一个新的修订版本,并且我在迭代过程中频繁部署。这些修订版本可能比预期的保持更长时间的“预热”状态。自动缩放加上修订版本激增意味着比直觉上更多的活动资源,即使没有流量也是如此。
计费警报失效:我启用了 50 美元的警报。我收到了一个早期的通知,然后就再也没有收到任何通知,而费用却又增加了 4600 美元。没有任何明确的信号表明我的成本状况发生了实质性变化。
我联系了 Google Cloud 计费支持部门,寻求明确的指导或部分减免。经过审查,他们拒绝了任何调整并关闭了案件。作为一个没有客户团队的独立开发者,除了接受这些费用之外,没有其他升级途径。
目前情况:在调整资源大小并清理修订版本激增后,我的每日成本从大约 200 美元降至低于 5 美元。我谨慎乐观,但不能确定问题是否已完全解决。
对于那些长期运行 Cloud Run 的人:作为一名独立开发者,您实际上如何限制下行风险?您是否设置了硬性预算上限并接受停机时间?是否有避免修订版本激增的部署模式?App Engine 在纯粹的成本可预测性方面是否仍然更可取?哪些保护措施有效,而又不必依赖持续的手动计费检查?
我并没有追求规模。我只是想在独自构建时谨慎理财。我很乐意听到其他人会采取哪些不同的做法。
查看原文
Dear HN,<p>I’m a solo operator with no paying customers yet. I wanted more predictable baseline costs while iterating on a side project, so I migrated from App Engine to Cloud Run.<p>I fed my setup, budget, and constraints as context into Gemini CLI, asked it to search official documentation and best practices, and followed that guidance.<p>I removed –min-instances=1, expecting autoscaling to reduce idle spend. The commit message claimed “60% cost savings.” The actual outcome was roughly an 1,800% increase and a surprise decline message when I went to buy coffee on my credit card.<p>From Nov 2 to Dec 14, Cloud Run accrued ~$4,676. There was no traffic spike, no abuse, no application bug. The services were mostly idle.<p>What compounded: CPU and memory were over-provisioned (4 CPU, 16Gi) from earlier experimentation. Each deploy created a new revision, and I deployed frequently while iterating. Those revisions must have stayed warm longer than expected. Autoscaling plus revision sprawl meant more active resources than intuition suggested, even without traffic.<p>The billing alert failure: I had alerts enabled at $50. I received one early notification, then silence as spend climbed another $4,600. There were no clear signals that my cost profile had materially changed.<p>I contacted Google Cloud Billing Support looking for clear guidance or partial relief. After review, they declined any adjustment and closed the case. As a solo dev without an account team, there was no escalation path beyond accepting the charges.<p>Where it stands now: After right-sizing resources and cleaning up revision sprawl, daily costs dropped from ~$200 to under $5 on my billing dashboard. I’m cautiously optimistic but not certain it’s fully resolved.<p>For those running Cloud Run longer term: How do you actually cap downside as a solo dev? Do you set hard budget caps and accept downtime? Are there deployment patterns that avoid revision sprawl? Is App Engine still preferable purely for cost predictability? What guardrails work that don’t depend on constant manual billing checks?<p>I wasn’t chasing scale. I was trying to be careful with money while building alone. I’d appreciate hearing what others would do differently.