# Building a private (& personal) CDN



## tortau (Sep 26, 2014)

Hi all,

I'm planning to build a private CDN network and was hoping to get some feedback and suggestions.

*Here's my scenario:*

I'm involved with a NFP organization that will be hosting an international conference in a few weeks. We have some videos to made available on the website (approx 5-10 minutes each but no more than 10) that will be unveiled then. Now they typically just host all the videos on one server (we don't want to post them on Youtube) but I have a bunch of low-end servers (OVH, Online.net) with plenty unlimited use of bandwidth and I figured why don't I take the opportunity to test a new setup. We are not expecting thousands of visits but perhaps hundreds over the course of the next couple months as the attendees go back to their country and spread word about the website.

*So my questions for thought are:*

1) I'm worried about CPU bottleneck. As mentioned, I have in my arsenal a phelora of old Atom CPUs like D425 (4GB), N2800 (2GB) and the VIA Nano U2250 (2GB) that I'd like to leverage here. Each server will run nginx (configured with max caching) and they will only serve files with no dynamic processing (PHP, etc) involved (at least, at this stage of planning). I can't imagine that will take a lot of CPU to process each request but to those who are more experience with heavy traffic, what do you think will be the max number of concurrent connections that each server would be able to handle?

2) I'm thinking of using Rage4's GeoDNS (or Amazon Route 53) feature to map the domain to the different servers based on location. This should do it, right? Or am I over-simplifying things here?

Since I can already imagine some comments, I wanted to put out a disclaimer before the trollers arrive:

This setup is meant for personal/friends-and-family use and not for reselling (at least, in the short term) so bandwidth & speed (e.g. room for growth) is not a concern at this point. I also want to take the opportunity to test a setup and see how it works out. In the long run, it is a programming and configuration exercise. I know I can use cheap servers like <fill in the blank here> for pennies but what fun would that be?


----------



## drmike (Sep 26, 2014)

Well....

1. CPU bottleneck.... old CPUs serving bits - no processing, no video server - just straight web server, yeah, shouldn't be a bottleneck.   At the point where that happens depends on size of files, number of files and how active the requests are.  You can move serious heaps of data on lowly hardware and should.

2. GEODNS - Rage4 makes it easy and cheap, but their service comes with higher latency on the lookups than competitors.  I often see lookups 150-300ms.   For you it might not matter, for me, it does.   So Rage4 on the cheap route.

Amazon has GEODNS functionality and their other pricing for DNS has been low/fine... unsure about the GEODNS, but here's a sample of setting such up [expect it to be different these days - April 2013 tutorial there]

http://www.cyberciti.biz/cloud-computing/aws/route-53-geodns-tutorial/


----------



## tortau (Sep 26, 2014)

drmike said:


> Well....
> 
> 1. CPU bottleneck.... old CPUs serving bits - no processing, no video server - just straight web server, yeah, shouldn't be a bottleneck.   At the point where that happens depends on size of files, number of files and how active the requests are.  You can move serious heaps of data on lowly hardware and should.
> 
> ...


1. Your mention of "no video server" brought up a point. I wonder if I should be configuring nginx with the mp4 or flv module for better seeking capabilities. Hmm. Anyone in the forums have thoughts on this? 

2. I've actually had brief moments of downtime with Rage4 previously. I don't know if it was Google's Public DNS fault because it just seemed that suddenly, one of my domain wouldn't resolve. I'd notice this because I was working on it that day. I checked another website hosted on the same machine and it worked (and resolved properly - not hosted on Rage4). I left it for about 30 mins and tried again and it was fine. Huh. Anyway, no notice on their website so I just ignored the incident as a one off but it did make me move some of my domains off to Rackspace. I was a freeloader on their system so I figured I had no reason to complain  But I most definitely will consider Route 53. It seems fairly affordable ~ $1.1/month for geodns queries.


----------



## drmike (Sep 26, 2014)

tortau said:


> 1. Your mention of "no video server" brought up a point. I wonder if I should be configuring nginx with the mp4 or flv module for better seeking capabilities. Hmm. Anyone in the forums have thoughts on this?


Well,  have fun experimenting with that.  Clearly seek capability involves more overhead and management of the stream.  You will take a hit there... How big, well, someone with such currently deployed can speak to the scale and capacity from current use.  Should be fine, just can rack and stupid simultaneous viewers to n'th degree


----------



## eva2000 (Sep 26, 2014)

What a coincidence doing the same thing - not for videos but for a GeoDNS SPDY SSL based CDN for my own use.

I tried Rage4 but decided on Amazon Route 53 and just offloading subdomains to Amazon Route 53 while my main domain name is using DNSMadeEasy   Have no clue on requirements for video serving though.


----------



## tortau (Sep 26, 2014)

eva2000 said:


> What a coincidence doing the same thing - not for videos but for a GeoDNS SPDY SSL based CDN for my own use.
> 
> I tried Rage4 but decided on Amazon Route 53 and just offloading subdomains to Amazon Route 53 while my main domain name is using DNSMadeEasy   Have no clue on requirements for video serving though.


My nginx is configured with SPDY and SSL too 

Problem with serving videos is that I'm unable to find a node in Asia region that is reasonable in price ... that's my main concern now :|


----------



## nunim (Sep 26, 2014)

tortau said:


> ... Problem with serving videos is that I'm unable to find a node in Asia region that is reasonable in price ... that's my main concern now :|


DigitalOcean Singapore is the most reasonably priced that I've found.

[Edit] You can also look at OneAsiaHost:  https://www.oneasiahost.com/


----------



## drmike (Sep 27, 2014)

DO and OneAsiaHost I can speak good about.   Used both for Asia in the past.  Both are fairly reliable and low issue operations.


----------



## fm7 (Sep 27, 2014)

tortau said:


> Problem with serving videos is that I'm unable to find a node in Asia region that is reasonable in price ... that's my main concern now :|


I suggest you Linode Japan.


----------

