Live data from Hacker News

Rolling your own CDN for $25 in 1 hour

scalescale.com

41–50 of 93 posts

Re: Rolling your own CDN for $25 in 1 hour

#41
I would highly recommend Varnish using S3 as a backend origin. Add to that a few 100TB.com dedicated server and you have an extremely cheap CDN with pretty decent bandwidth and minimal maintenance.

CDNs have the advantage that they control more of the stack so can do more precise routing and have more edge nodes in more places. However, under the right circumstances, you can take the above quite far before a real CDN becomes necessary.

Re: Rolling your own CDN for $25 in 1 hour

#42

I would highly recommend Varnish using S3 as a backend origin. Add to that a few 100TB.com dedicated server and you have an extremely cheap CDN with pretty decent bandwidth and minimal maintenance. CDNs have the advantage that they control more of the stack so can do more precise routing and have more edge nodes in more places. However, under the right circumstances, you can take the above quite far before a real CDN…

hey Daniel- thanks for the comment. Do you run any special varnish config settings w/ s3?

Re: Rolling your own CDN for $25 in 1 hour

#43

I'd recommend CloudFlare if you want AnyCast geo-DNS, and a free CDN. We don't charge for bandwidth or our DNS service. Disclosure: yes, I work at CloudFlare but the previous details are simply facts.

Hi, I heard that CloudFlare is now blocked in China, do you have more information?

Re: Rolling your own CDN for $25 in 1 hour

#44
post #29

Earlier quoted context omitted.

Do you have a link to CloudFlare geo-DNS? I have multiple servers in multiple parts of the world, and didn't know that Cloudflare supported that.

CloudFlare uses AnyCast. We'll route any incoming requests to the nearest data center automatically. http://blog.cloudflare.com/a-brief-anycast-primer No additional configuration required. If you're referring to making different origin calls based on the geographic region -- such as when we go back to your origin for a request hitting our LAX data center if you happen to have an origin near LAX we'd use that origin s…

anycast does not route to the geographically nearest datacenter but the topologically nearest. anycast is great, but it isn't magic.

I get it: you have marketing folks that probably specifically told you not to delve into the details but let's face it..."anycast routes it to the nearest datacenter automatically!" isn't completely true.

Re: Rolling your own CDN for $25 in 1 hour

#45
post #44

Earlier quoted context omitted.

CloudFlare uses AnyCast. We'll route any incoming requests to the nearest data center automatically. http://blog.cloudflare.com/a-brief-anycast-primer No additional configuration required. If you're referring to making different origin calls based on the geographic region -- such as when we go back to your origin for a request hitting our LAX data center if you happen to have an origin near LAX we'd use that origin s…

anycast does not route to the geographically nearest datacenter but the topologically nearest. anycast is great, but it isn't magic. I get it: you have marketing folks that probably specifically told you not to delve into the details but let's face it..."anycast routes it to the nearest datacenter automatically!" isn't completely true.

Hey, this brings up a good point for some more clarification.

There are two common ways CDNs do routing:

method 1) by using a customized dns server (like the one I used in the example) that responds differently to the resolvers end users use. You can use something like Maxmind (like I did in the example) to determine where you think that resolver is.

method 2) you can use anycast all the way to the TCP level for terminating traffic to ports 80 and 443. This is the most common way we do it at MaxCDN.com. We find it to be the fastest.

To do method 1 you can use the Go GeoDNS server from github (and there's one in PERL) or you can use a service like Dyn.com, DNSMadeEasy (only has broad geo), NSone.net, Verisign's DNS product or Cedexis (which can also incorporate latency data). One thing to keep in mind with doing DNS based routing is eDns for the big public DNS providers. The downside is that you can only respond by the resolver or edns subnet someone uses which can lead to a lot of inaccuracies. The big pro about method 1 is it's easy to deploy and it's easy to balance traffic if a PoP gets over loaded since it's just DNS records.

Anycast (Method 2) is great and fast, but it is high maintenance. We've spent a lot of time tweaking this over the past 4 years at MaxCDN. I've heard you can announce anycast blocks with ServerCenteral and Internap, but I haven't tried it. I've done it with Softlayer for testing. You need to have your own /24 to do it with them. We have our own infrastructure and several upstream providers. The biggest challenges with anycast are dealing with Asia (to make sure routes don't trombone) and traffic management since you can't control where traffic goes.

One of our guys did a blog post on this a while ago: http://blog.maxcdn.com/anycast-ip-routing-used-maxcdn/

Hope this is useful for some!

Re: Rolling your own CDN for $25 in 1 hour

#46

I would highly recommend Varnish using S3 as a backend origin. Add to that a few 100TB.com dedicated server and you have an extremely cheap CDN with pretty decent bandwidth and minimal maintenance. CDNs have the advantage that they control more of the stack so can do more precise routing and have more edge nodes in more places. However, under the right circumstances, you can take the above quite far before a real CDN…

100TB.com specifically forbids using their service to create a CDN in their ToS[0].

    9. Acceptable Use/Illegal Activity

    d. We strive to maintain a high level of service, and a lot of
    customers depend on our high standards of quality. As such, we
    will not provide Services to those that are using our Services
    for:
    
    vii Using the Services for a content delivery network or content
    distribution network (CDN). An authorized CDN network offered
    through 100TB is accepted. Special requests to use the Services
    to run an unauthorized CDN network may be approved on a case-
    by-case basis. Failure to comply with this policy will result
    in termination of this TOS, and you will not receive a refund
    of the Fees.
[0]: http://www.100tb.com/tos.php

Re: Rolling your own CDN for $25 in 1 hour

#48
post #47

Now with libcloud ( http://libcloud.readthedocs.org/en/latest/compute/drivers/ ) you can use multiple platforms in order to get all continents represented. Including Africa ( http://kili.io ) where I'm at.

awesome. Thanks for posting. I had that as one of my todo's in the blog post. Feel free to reach out to me if you want to help with a follow up post!

Re: Rolling your own CDN for $25 in 1 hour

#49
post #44

Earlier quoted context omitted.

CloudFlare uses AnyCast. We'll route any incoming requests to the nearest data center automatically. http://blog.cloudflare.com/a-brief-anycast-primer No additional configuration required. If you're referring to making different origin calls based on the geographic region -- such as when we go back to your origin for a request hitting our LAX data center if you happen to have an origin near LAX we'd use that origin s…

anycast does not route to the geographically nearest datacenter but the topologically nearest. anycast is great, but it isn't magic. I get it: you have marketing folks that probably specifically told you not to delve into the details but let's face it..."anycast routes it to the nearest datacenter automatically!" isn't completely true.

Good point. In my testing of CF, I couldn't get my requests route to nearest datacenter though CF status page indicated green for datacenters near my request origin. It always routed me to SJC irrespective of which location the request originated from in US.

Re: Rolling your own CDN for $25 in 1 hour

#50
post #44

Earlier quoted context omitted.

CloudFlare uses AnyCast. We'll route any incoming requests to the nearest data center automatically. http://blog.cloudflare.com/a-brief-anycast-primer No additional configuration required. If you're referring to making different origin calls based on the geographic region -- such as when we go back to your origin for a request hitting our LAX data center if you happen to have an origin near LAX we'd use that origin s…

anycast does not route to the geographically nearest datacenter but the topologically nearest. anycast is great, but it isn't magic. I get it: you have marketing folks that probably specifically told you not to delve into the details but let's face it..."anycast routes it to the nearest datacenter automatically!" isn't completely true.

Surely topologically closest is most often what you want anyway?
Post reply on HN