
Ask HN: AWS S3 billed us over $1k. What cheaper alternatives do you recommend? - zeeshanm
I run an image sharing website and AWS recently billed us over $1k for bandwidth costs:<p>http:&#x2F;&#x2F;i.imgur.com&#x2F;sGrYboT.png<p>What cheaper alternatives do you recommend?
======
davismwfl
While you might be able to reduce costs through dedicated services, it also
means you are going to have to write more code, maintain it and also maintain
the machines etc. Don't underestimate that there are significant costs to do
this reliably and maintain it over time as things grow. If you do need to do
it though, I might suggest trying at least at first to use a csync2 with lsync
on linux to manage the distribution of the files across the machines. We use
this even in AWS for a site and it works really reliably, quick and was easier
then managing a distributed FS.

But before I would go that route I'd probably first try setting up a proper
CDN for the images and take advantage of the caching settings so you can
reduce your S3 bandwidth charges.

Also, if you don't already have it, I'd also setup some monitoring on your AWS
account to give you a weekly update on account charges & usage so you can see
what is going on.

------
willejs
Set up a cheap CDN (MaxCDN is a good bet as someone else has mentioned) this
website will help - [http://www.cdncalc.com/](http://www.cdncalc.com/) this
will half your monthly costs.

I would stick with S3 for the origin to start with, setting up a bunch of
servers to reliably store and serve data is a pain, and one you should avoid
it if you can. On the CDN enable origin shielding, and set TTL of the images
to never expire if you can. This will lead to images only to be served once
from s3. When they upload, link to the CDN'd asset, it will pre-warm the CDN
for subsequent requests.

Without knowing the trends in your traffic, how much data you are storing etc,
its hard to give you really good advice.

~~~
zeeshanm
We have over 200gb of storage. Mostly image files.

------
radq
What we do is run Varnish in front of S3 to cache files on machines with
cheaper bandwidth.

[https://github.com/hummingbird-me/ansible-
deploy/blob/master...](https://github.com/hummingbird-me/ansible-
deploy/blob/master/roles/varnish/templates/default.vcl)

It is very little work to set up, and you don't need to modify your code and
migrate your files to a different service. Setting up a CDN might have been
easier but this works out cheaper for us.

------
vitovito
Host it yourself with dedicated servers in a colocation center.

S3 is expensive for use cases like an image sharing service. Running your own
servers with dedicated, unmetered bandwidth (or at least metered bandwidth in
the 20TB+ range) is cheaper.

If 11TB of network transfer is spread out evenly over the month, a 100mbit
uplink would handle it with plenty of room to spare. (Your traffic is probably
not evenly distributed, it's probably very bursty.)

------
nodesocket
Setup an origin box (or a few and use a load balancer) running nginx. Then use
a CDN (we love MaxCDN) to pull from the origin. Make sure you setup the cache
headers right in nginx. Something like:

    
    
      location ~* \.(?:ico|js|css|gif|jpe?g|png|xml)$ {
        expires 30d;
        add_header Pragma public;
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
      }

------
andsmi2
This is a lot of data to transfer. As suggested caching and cloud front. And
start figuring out how to pay for it (advertising or charging customers-- I
would think with that much data being transferred there should be a revenue
stream already to cover $1k a month or perhaps it isn't scalable)

------
olalonde
Another option that was not mentioned is to make sure your HTTP server has
caching setup properly.

------
JonM
Perhaps consider an enterprise agreement with AWS? We've saved $large without
needing to switch providers just by committing to a minimum monthly volume of
data transfer.

Worth seeing the numbers before you invest in dev & operations.

------
iSloth
Go buy some cheap dedicated servers from places like OVH and create your own
fairly simple CDN/Hosting. You could easily chop that cost by 70%+

Or is there anything specific in S3 feature that you need replicated?

~~~
bsaul
I suppose replication and sharding over multiple hosts, as well as a key
system for file indexing and serving.

------
bhaumik
Not exactly an alternative but you can get $1000 off by finishing two
entrepeneurship courses on EdX.

[https://www.edx.org/AWS-activate](https://www.edx.org/AWS-activate)

~~~
readme
Not two: either of the two. Even better. I already signed up and paid.

------
zeeshanm
Thanks for all the ideas. For now we are going to route traffic via cloud
front and set cache to almost never expire. We've also compressed images and
it looks good so far.

------
Terretta
Other suggestions here are good. In the meantime, start saving money instantly
by fronting S3 with AWS CloudFront instead of serving images directly from S3.

------
rememberlenny
People have mentioned a CDN or Varnish. You need something that will cache the
images on a CDN level to reduce traffic. Cloudflare, Fastly, etc.

------
x3sphere
I'd recommend 100TB.com, can even get a box in Softlayer's datacenter from
there for $50/extra a month.

------
hubot
CDN would help a lot in this case and is a lot cheaper.

------
infinitone
I find digitalocean pretty cheap.

------
ddorian43
runabove(cheap s3 alternative) or soyoustart(cheap 200mbit servers)

