惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
Microsoft Azure Blog
Microsoft Azure Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog
Y
Y Combinator Blog
博客园_首页
有赞技术团队
有赞技术团队
博客园 - Franky
腾讯CDC
G
Google Developers Blog
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
D
Docker
The GitHub Blog
The GitHub Blog
MyScale Blog
MyScale Blog
H
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
A
About on SuperTechFans
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
V
V2EX
U
Unit 42
aimingoo的专栏
aimingoo的专栏
WordPress大学
WordPress大学

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How I Reduced My Cloud Bill by 60% Without Touching My Code
SHY Gamer · 2026-05-11 · via DEV Community

SHY Gamer

Last year I was paying $340/month for infrastructure that served ~50k monthly active users. Today I pay $136/month for the same load. Here's exactly what I changed — zero code rewrites required.


The Problem With "Just Scale It"

When your app grows, the instinct is to throw more compute at it. Bigger instances, more replicas, auto-scaling groups. But scaling up is almost never the right first move.

The right first move is measuring what you're actually using.


Step 1: Audit Your Instance Utilization (Found: $80/mo savings)

I ran a 2-week monitoring period and discovered my "production" servers were averaging 11% CPU utilization. I was paying for large instances because I was scared — not because I needed them.

What I did:

  • Downgraded from 4 vCPU / 8GB RAM → 2 vCPU / 4GB RAM instances
  • Set up proper alerting so I'd know if load actually spiked

Tool used: DigitalOcean Monitoring (free, built-in)

👉 DigitalOcean's droplets start at $6/month and the monitoring is free. Way cheaper than AWS for typical apps.

Savings: ~$80/month


Step 2: Kill Idle Databases (Found: $60/mo savings)

I had 3 managed databases running. One was for a project I'd abandoned 8 months ago. One was a "staging" database that nobody used. Only one was actually needed.

# Quick audit — list all your databases and their last connection time
# In DigitalOcean: Manage → Databases → check "Last ping"

Enter fullscreen mode Exit fullscreen mode

Delete the ones you haven't touched in 30 days. You can always restore from snapshots if needed.

Savings: ~$60/month


Step 3: Move Static Assets to Object Storage (Found: $45/mo savings)

I was serving images, videos, and PDFs directly from my app servers. This is expensive and slow.

The fix: Move everything to object storage (Spaces, S3, R2) + CDN.

Before: App server → user (slow, uses compute bandwidth)
After:  CDN edge node → user (fast, costs fractions of a cent)

Enter fullscreen mode Exit fullscreen mode

Object storage costs ~$0.02/GB vs. $0.10+/GB on compute bandwidth. For a media-heavy app, this adds up fast.

Savings: ~$45/month


Step 4: Optimize Your Database Queries (Found: $19/mo savings)

This one did involve looking at code — but not rewriting it. I just added missing indexes.

-- Before: 2.3 second query, full table scan
SELECT * FROM events WHERE user_id = 123 AND created_at > '2026-01-01';

-- After: Add composite index
CREATE INDEX idx_events_user_date ON events(user_id, created_at);
-- Same query: 12ms

Enter fullscreen mode Exit fullscreen mode

Faster queries → smaller database instance needed → cheaper plan.

Savings: ~$19/month


Step 5: Use Reserved/Committed Pricing (Found: $36/mo savings)

If you've been running the same infrastructure for 6+ months, you're probably on on-demand pricing. Switch to committed pricing (1-year commitment) and save 20-40%.

I committed to my core infrastructure for 1 year and saved 36% immediately.

Savings: ~$36/month


The Full Breakdown

Change Monthly Savings
Rightsize instances $80
Kill idle databases $60
Object storage for assets $45
Query optimization $19
Committed pricing $36
Total $240/month

That's $2,880/year — back in my pocket, no performance regression.


Where to Start Tomorrow

  1. Open your cloud dashboard and look at CPU utilization graphs for the last 30 days
  2. List every database — if one hasn't been touched in 30 days, snapshot and delete it
  3. Check your bandwidth bill — if it's high, you're probably serving static files wrong

The best part? None of this requires a rewrite. It's just configuration and common sense.


Running on DigitalOcean and want to optimize? Their cost estimator and monitoring tools make this audit trivial. New accounts get $200 free credit — enough to experiment without risk.


What's your biggest infrastructure cost sin? Mine was definitely those zombie databases. Comment below 👇