
Distribute Your Content With Amazon CloudFront - jeffbarr
http://aws.typepad.com/aws/2008/11/distribute-your-content-with-amazon-cloudfront.html
======
ryanmahoski
I'm seeing 38% faster downloads from Phoenix (nearest CloudFront edge: L.A.).
I ran 5 trials on a 178MB video hosted on S3 [1] and CloudFront [2]. The S3
GETs took: 6m02s, 1m50s, -failed after 28MB- , 2m01s, 2m04s. The CloudFront
GETs took: 3m40s, 1m10s, 1m23s, 2m05s, 1m25s. Ignoring the failed S3 run, we
can compare average client latency: 2m59s vs 1m50s.

[1] <http://2008.s3.amazonaws.com/09/javascript.mp4>

[2] <http://d11tgpuxrsgxu4.cloudfront.net/09/javascript.mp4>

~~~
tlrobinson
Surprisingly CloudFront was almost twice as slow as S3 for me (though I only
tried it once):

[1] 6m 56s

[2] 11m 22s

~~~
ryanmahoski
Yes that is interesting without being shocking. True we can't conclude
anything from one spin so if you have time please run it again and share. If
it was an anomaly then I think it's: a) merely verification that the pipes
downstream are unreliable and/or b) your edge location didn't have the file
cached so fetched from S3 before serving to you. But if you continue to see
unexpected results do tell.

~~~
tlrobinson
S3: 10m 53s, 6m 24s, 10m 15s

CloudFront: 8m 37s, 8m 12s, 8m 17s

------
lux
I wonder how this compares to Mosso's CloudFiles? They've already been
offering a CDN built-in, but I haven't done any testing myself yet to compare
their services (latency, etc).

Cost comparisons run very close using their cost calculators for just
CloudFiles vs S3...

~~~
edjy
Mosso's Cloud Files uses Limelight Networks' system. It's not a one-off with
Limelight either, it's the same CDN service any of their customers use.

In addition to ReST, PHP, Python, Java, and C# API's, there is also a web-
interface that makes it easy to sign-up, upload content, and CDN-enable it.

------
xal
Are there any guarantees on how fast files are invalidated on the edge
servers? Running curl on those urls gives a lot of insight ( X-Cache: MISS ...
) into what's going on but it seems that invalidation of resources take 10-15
seconds. The X-Cache changes immediately but you only get a miss after a
while. At least that's what I've been seeing in my pretty trivial tests.

------
tlrobinson
This is general CDN question: how does one enable compression for CDN-served
resources?

In Apache I just enable mod_deflate or mod_gzip, or serve up a .gz and set the
Content-Encoding to gzip.

Do CDNs offer this somehow?

Can I set arbitrary headers like Content-Encoding?

Also, does anyone have stats on which browsers support deflate and gzip
encodings? I imagine the vast majority at this point do.

~~~
crabapple
the point of a cdn is to give you an SLA and honor it. how they configure
their delivery platform should be opaque to you, its not like you are going to
be getting a shell on the cdn machines anyway

~~~
tlrobinson
So can someone else answer my question then? If I want my content gzip encoded
are CDNs simply not an option?

------
jmtulloss
Amazon is a bad-ass.

~~~
alecco
They are doing a fine job, yep.

Something I couldn't find is support for SSL. That's key for CDN services.

~~~
briansmith
Signing up for a SSL certificate using your own credentials and then letting a
third-party distribute and use your private key on an arbitrary number of
systems you have no control over is bordering on fraud.

~~~
alecco
We are talking about a cloud service and the same company's CDN system. They
already would have said certificates running possibly in multiple hosts. How
do you get to "bordering on fraud" from there?

 _FAIL_ (Because of your reply tone, please try to be more civilized next
time, shame on your up-voters too.)

~~~
briansmith
If I give my certificate that says "this is Brian Smith" to Amazon, and then
Amazon uses it to claim to be me, then that is very misleading. It is very
similar to me giving my driver's license to my underage brother so he can buy
me beer.

If CloudShare used its own "this is Amazon.com's Cloudshare Service"
certificate then it might be okay, except (1) they would be using it to sign
content that they haven't verified the authenticity of, which is misleading
(like notarizing something without any authentication), and (2) you almost
always need to mix those static assets with dynamic assets or HTML forms and
that all has to happen on the same domain--the domain that receives the POST
requests, not the CDN's domain--in order for things to work reliably.

As for tone: the tone with which I wrote my reply is apparently not the same
as the tone with which you read it.

~~~
alecco
No (x3)

------
lennysan
Love the fact that you guys added the service to the Service Health Dashboard
immediately: [http://www.transparentuptime.com/2008/11/amazon-launches-
fes...](http://www.transparentuptime.com/2008/11/amazon-launches-festivus-of-
cdnsa-cdn.html)

------
EastSmith
Just read the docs, it seems that when you put a file in the CDN they
distribute it on all edge servers and you paid for that (which is normal). But
it would be great if you can chose on which servers you want the files
distributed to. For example I might need the servers just from the european
region.

If you have couple of files in the CDN it will not make sense, because the
cost to distribute the files around will be marginal, but if you have many GB
of data, distributing them to all unneeded servers might be not cost
efficient.

~~~
jeffbarr
CloudFront uses a pull model, not a push model. When a particular node needs
the data and doesn't have it cached, the node fetches the data from S3.

~~~
WestSorkin
Aha, 10x!

------
wensing
Can't wait to start using this for Stormpulse. Our traffic is extremely geo-
specific (usually Texas and/or Florida), so this is going to help.

To be frank, I haven't been completely satisfied with S3, so maybe this will
help insulate us from those outages as well, assuming the content is already
cached at the edge.

------
mdasen
Has anyone noticed that the transfer charges for the United States are
actually less than the charges for S3 once you get over 10TB? Other than the
added cost of distributing the files to the CDN, wouldn't that make the CDN as
cheap or cheaper than S3? Great place to put your most accessed files.

~~~
wmf
That's kinda the point. Since bits from a CDN travel less distance, Amazon
charges less.

------
Tichy
OK, dumb question, but I thought there was this thing called Apache HTTPD that
was traditionally used for serving static content? What ever happened to that?
Granted, it has one basic flaw, in that it doesn't deliver usage statistics of
my site to Amazon, but other than that?

~~~
rmaccloy
Serving static content from Apache or lighttpd is trivial.

Putting multiple boxes hosting that httpd in various geolocations, setting up
DNS and BGP to route users optimally, designing failover routes and keeping N
nodes in sync is the hard part.

~~~
Tichy
True, but when does one reach a size (user base) at which stuff like that
becomes critical?

~~~
emmett
The same size one should start using any CDN - as soon as you start caring
about page load speed.

~~~
Tichy
OK, I forgot about that problem (I assume it is the limitations of browsers to
two connections per server at a time).

~~~
wmf
You can work around that with multiple hostnames, but lower latency is still
better.

------
aniketh
from the pricing table, I noticed that the cost in Japan was the highest. I
always thought that Japan had a lot of bandwidth.

~~~
rmaccloy
Space + power? Also, AU and SE Asia will be routing to HK or Japan, and that
would tend to be more expensive.

