# Setup CDN



## RA4W (Jun 7, 2014)

I was just wondering if anyone could point me in the right direction, been trying to google a bit but havent really found anything.

So basically i want to setup my own CDN on my own servers.

Thanks.


----------



## HalfEatenPie (Jun 7, 2014)

If I recall correctly a ton of people use nginx or squid to setup a CDN.

http://blog.unixy.net/2010/07/how-to-build-your-own-cdn-using-bind-geoip-nginx-and-varnish/


----------



## Nikki (Jun 7, 2014)

If you have multiple nodes per country the standard GeoDNS stuff won't work too well, you'll usually have to find a provider that supports distance based GeoDNS.

Use the nginx config from the blog post above, then use something like Rage4's "closest server first" mode for it.

I'm currently running a cdn-type thing with 5 servers on a custom powerdns based geodns system and it works quite well, I believe if you have the time Rage4 may be even better.


----------



## HalfEatenPie (Jun 7, 2014)

Yeah Rage4 is an Anycast DNS system.  So it's probably best to use that over a self-rolled DNS system.


----------



## Mun (Jun 7, 2014)

Do you really need a CDN, that is a really important question to ask yourself.


----------



## drmike (Jun 7, 2014)

Mun said:


> Do you really need a CDN, that is a really important question to ask yourself.


^--- This.

You really need to be pushing a ton of traffic and lots of users (normally)... And, should be rather heavy on image type content.

Other CDN plays for stuff like nearest download site which attempt to get files on short distance path and ideally lower latency (which is meh, random on how well such really works end user performance).

Rage4 Geo-DNS stuff is just way too simple not to start with, and the price is right.  Still can utilize your machines, VPS, etc. with that and no need to engineer the DNS layer solution to determine which node to put user on.


----------



## ihatetonyy (Jun 7, 2014)

I'd heavily recommend Rage4; their GeoDNS is great.


----------



## VPSCorey (Jun 7, 2014)

Our CDN runs from 0.025 to 0.04 per GB plenty of capacity and over 80 pop's.


----------



## Mun (Jun 7, 2014)

so 100 gb = $4.00 seems quite expensive.


----------



## ihatetonyy (Jun 8, 2014)

Mun said:


> so 100 gb = $4.00 seems quite expensive.


Unless my math is wrong (_very_ distinct possibility), MaxCDN is $9/mo for 100GB, CloudFront is $12 for 100GB, and CDN77 is $4.78 for 100GB.

Especially if his CDN solution includes more expensive countries in Asia/Australia/S. America, that's not a bad price range.


----------



## Mid (Jun 9, 2014)

I have no hands on experience, but assuming there is no overselling involved in this, watching bandwidth price ($/GB) on vps providers (linode: 0.01 , knownhost: 0.01 , ramnode,chicagovps,digitalocean: 0.005 to .01 , ovh: 0.001 and less), most of them tend to be 5 to 10+ times cheaper than the CDN counterparts (cdnplanet.com has a list of CDNs).

i.e cdn77 is 5 times costlier, ther rest are 10 times (or more) costlier. So, unless you really require a CDN (for search engine benefit?, etc) or you don't care about bandwidth costs, you don't need to go for a CDN I think. On the aspect of reducing downtime, may be multiple (2 or 3) vps/dedicated can be used.

I can't believe the ovh pricing, is it really true (ovh 100+ times cheaper than cloudfront)? Their SoYouStart servers (soyoustart.com/us/essential-servers.xml) claim 250 Mbps bandwidth. Assuming 12 hours of usage per day, it amounts to 40 TB per month bandwidth (250 / 8 * 60 * 60 * 12 * 30 / 1024). Price range of $42 to $63, means 0.001 to 0.0015 per GB.

Any one using them? Again, Is it really true?


----------



## texteditor (Jun 9, 2014)

Mid said:


> Their SoYouStart servers (soyoustart.com/us/essential-servers.xml) claim 250 Mbps bandwidth. Assuming 12 hours of usage per day, it amounts to 40 TB per month bandwidth (250 / 8 * 60 * 60 * 12 * 30 / 1024). Price range of $42 to $63, means 0.001 to 0.0015 per GB.
> 
> Any one using them? Again, Is it really true?


This is kinda a derail, but it's closer to like ~75-80TB outbound if you are maxing it, also inbound b/w on the soyoustarts is generally full gbit


----------

