Hi Guys
I just signed up with Rackspace Cloud CDN and tested some image load times and it was much slower than loading the same images from my Dedicated Server. I don't see the purpose of using a CDN to load images and CSS if your on a dedicated server. What do you guys think?
The point of a CDN is really for international distribution. If your server is in X country then a CDN is probably not going to be much faster loading in X country, in many cases I think it can be slower because of the extra connect times to another server vs loading from a local dir.
If you are sending traffic from South Africa and your server is in the US... well a CDN is probably going to out-perfrom your dedicated for static content in that situation.
Yep, exactly.
I'd go so far as to say that a CDN will usually be slower than a regular VPS or dedicated server if the VPS/dedi server is in the same country as the person requesting the content from it. It's only if your server is in another country or on another continent that a CDN - which is designed to have servers all over the world - becomes faster.
To give you a specific example I've been testing recently: a simple landing page app running on Google App Engine (which is essentially on a CDN by default) has about a 400ms load time from the US. If I buy another US server and put my LP on that, I can get load times below 100ms.
However, if I load that Google App Engine page from Shanghai, Brisbane, Sao Paulo or Prague, it'll still load in about 400ms. My page on a US server, by contrast, may take up to 2 seconds to load from some of those locations.
cdn's do make a diff but you have to make sure pages are built for them....
I have seen very few cases where across the board CDN's aren't faster.....
for example....
if you server is in Cali and someone in NY tries to load you page....there is absolutely no reason why a cdn shouldn't be faster...it has nothing to do with the loading of images....It has to do with the latency of the internet.....and the cashing that the CDN provides....
the latency between coasts of the US is gonna be in the 100-200 mil range....while loading from a CDN edge location in NYC is gonna take about 20-30 mil ....and do remember its not just 1 request its like most lps make multiple requests,....so you could be saving quite a bit of overhead....by removing that latency entirely...aka the CDN
as far as setup is concerned.....you have the choice of push or pull zones.....
if you setup a push zone then all your content is "pushed" to servers....if you setup you pages correctly like they are 100% fully hosted off the CDN....there is no way your dedi will load faster on avg unless your connecting to the dedi from a location that is very close to the dedi....aka doing a speed test from dallas and the dedi is located in dallas....
if your doing PULL zones it take a while before all of your content is PULLED to the CDN edge locations.....keep this in mind when your testing fresh pages....like pages you just made or uploaded to your server
the other point here i will make is your server under load.....remember your dedi doesn't only load html it does all of your tracker shit as well.....as you increase in requests you will get more and more timeouts.....one of the biggest advantages of a cdn are just offloading those requests to a different server entirely (the cdn).....
there is about 0 reason not to do inline CSS for what we do....our pages on avg are very very basic....and all it does it ad an additional request that in my opinion isn't needed....I know that sounds counter to all that is holy in HTML and yes my code looks like shit and amateurish.....but fuck that....every test I have done shits loaded faster when the CSS is in the HTML .....and I eliminate and entire request.....
also since many of us use PHP on pages to do things....CDN + PHP = suck......CDN's aren't meant to run PHP the request gets forwarded back to the server (if you using the CDN as a PULL zone) ......so you for the fancy smanchy web stuff you need to do you need to use JS instead of php so it can be loaded off the CDN and run client side....or you need to eliminate the fancy smanchy stuff.....
@polar - interesting stuff!
I remember from my adult webmaster days, most of the TGP and traffic trading scripts were written in C for maximum speed. I wonder if the performance gains from writing scripts in C are now null because of the increase in CPU power.
I mention this because I was thinking that there might be a market for new tracking scripts and one of the adult guys could write one easily.
Honestly, if it's compiled or not makes no difference since we track http requests, there are many other bottlenecks than the speed of the code execution. PHP might be slower in benchmarks, but in the real world it makes zero difference in this usage case.
Indeed - PHP execution is a matter of a few milliseconds. It's far more interesting and important to track the CPU/memory load for each language.
Database access times, on the other hand...
Rackspace cloud services in general are hype and low performance... I've yet to see rackspace do anything faster. Their network sure as hell isn't impressive. 100M ports are still bleeding edge technology over there. Were offering 10G to customers!
OK, I'm setting up a benchmark between CDN and single server in the continental US! Watch this space for the post!
Great cant wait
Snowed under at present, but I've talked to some people and I'm going to attempt to schedule this as soon as possible. I'll try and get 'em done before the F5 Meetup in May!
Yeah, sorry about that, Tyler! I'm adding you on Skype literally right now, and we can sort out the details ASAP!