Rolling your own CDN for $25 in 1 hour
scalescale.com
scalescale.com
"We setup DNS info to point here (both NS1 and NS2..."
That's great, but it would be nice to see:
"Using the geodns web-based configuration tool, we setup DNS info to point here (both NS1 and NS2..."
or
"Running <insert full command line here including tool and all options used here> on <insert environment here>, we setup DNS info to point here (both NS1 and NS2..."
or
"By editing /etc/<file> on the <some environment>, we setup DNS info to point here (both NS1 and NS2..."
In other words specifics are always really great to include.
But still this was a really great writeup, not just for the overview it gives of one lightweight approach but for the comments it has kicked off.
This article title piqued my interest but in the end it lack some key pieces of info I would need to try.
This also feels lacking to me. How does one order a DNS instance from DO? I can tell from the icon that it has something to do with CentOS but I don't see any sort of DNS server under their available applications or images for a one-click install.
It seems based on my recent trial experience with CloudFlare that both CDN startups might have this issue of incomplete/insufficient instructions and information for their users/customers to properly implement the solution and lot of assumptions about the skill level of users implementing the solution.
Actually, I landed up providing detailed instructions to CloudFlare on configuration and testing of their service. And a list of questions, answers to which should be readily available if CF is targeting enterprise customers.
Disclosure: yes, I work at CloudFlare but the previous details are simply facts.
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 specifically versus your other origin which might be located in let's say LHR. We currently only support that functionality for our higher end enterprise contracts. The functionality will likely to be available for other plan levels in the future though.
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.
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!
That is correct, and as you point out in a later comment -- in roughly perhaps 85-90% the geographic route and the topological route will be identical and ideal. In the other 10-15% cases some additional network engineering can be done to work with a problem ISP to correct the less than ideal routing for a customer.
not that Geo location from notoriously inaccurate whois data is any better.
That being said, if you control both sides you can do some better stuff (ie: Aspera, Netflix clients, etc) you can really ensure accuracy. Please feel free to post any good links to this stuff.
has it gotten better in five years? is an exercise left for the reader :)
[1] http://research.microsoft.com/en-us/um/people/maheshba/paper...
The GFC (Great Firewall of China) also changes daily (or sometimes hourly) so it's entirely possible whatever may have been an issue at one point in time has already been addressed.
also kind of unusual that this blog post is by the president of MaxCDN.
It makes a lot of sense for the president of MaxCDN to make a blog post like this. Bob the developer decides to learn about how CDN's work and happens upon this blog post. Cool, Bob just built his own mini CDN network for fun. Now Bob understands that his CDN, though a fun weekend project, is definitely not production ready. What does Bob do when he needs a CDN he can put into production? He goes to the guys that established themselves as authorities on the topic: MaxCDN.
Content Marketing 101: http://www.kalzumeus.com/2012/02/09/why-i-dont-host-my-own-b...
Their current policy FAQ says they do not even explicitly forbid Tor exit nodes, although there is a stern warning, so why would they disallow a proxy configuration dedicated solely to your site?
Afterall, what is the difference between serving assets out of your webserver
If you build a smallish network of, say, 10 of the $10/mo, 2-TB-traffic DO servers, and can manage to spread the load such that you use an average of half of the free allocation, you pay $100/mo for 10 TB. Cloudfront would charge you $1200/mo for that data transfer. Obviously it's not the same level of reliability or ease of scaling, but it's cheaper enough to be vaguely intriguing—$1200/yr versus $14k/yr is non-peanuts!
I get that they're trying to keep things simple for their demo, but unsuspecting folks following this guide are in for quite a shock when their GeoDNS is taken out by a single physical server fault.
http://www.slideshare.net/natmorris/anycast-on-a-shoe-string
More notes on GeoDNS http://edoceo.com/howto/geodns
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.
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.phpIncluding Africa (http://kili.io) where I'm at.
:) You submitted the link to HN and that comment makes it seem like the post accidentally took off!
full disclosure, I have no business or personal connection to them