GitHub
Blog
PreviousNext

My AWS Bill Exploded, and EC2 Was Not the Culprit

My AWS Bill Exploded, and EC2 Was Not the Culprit

I blamed EC2 for my rising AWS bill. The real cost was S3 and data transfer from serving huge, unprocessed images. Here is how preprocessing and multiple resolutions fixed both cost and speed.

My app recently started eating up my AWS bill, and at first I blamed EC2.

Turns out, the real culprit was S3 and data transfer.

The rookie mistake

I was doing the classic thing:

  • Uploading images directly to S3
  • Serving them as-is
  • No preprocessing
  • Huge file sizes
  • Slow loading on the client
  • Massive cost

The result was a high bill and bad performance, at the same time.

The fix

I fixed it the right way:

  • Preprocess images after upload
  • Store multiple resolutions
  • Serve the right version based on the client's network
  • Reduce storage and bandwidth

The outcome

  • Significant cost drop
  • Faster UX
  • Scalable architecture
  • A smarter system overall

Key takeaway

Cloud doesn't become expensive on its own. Bad architecture makes it expensive.

Design intelligently. Measure. Optimize. Learn.