Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

so I have move most of the static objects to amazons Cloudfront CDN

example: http://images.storyfollower.com/images/cycleOfStories.jpg which through cname point to the cdn

Now I just ran a speed test and the site is much slower?????

With cdn: http://tools.pingdom.com/fpt/#!/BmxPlstTp/storyfollower.com 1.7 sec

Without cdn http://tools.pingdom.com/fpt/#!/nFmp4l3Ez/storyfollower.com 0.8 sec.

I basically moved all the css / js / and images over to the cdn Did I do something wrong?

Have a look for your self at http://storyfollower.com

WHY is this happening?

Thanks

share|improve this question

migrated from stackoverflow.com Feb 11 '12 at 19:36

This question came from our site for professional and enthusiast programmers.

6  
CDN doesn't exactly make anything faster. It just allows you to make your website scalable. –  Amir Raminfar Feb 11 '12 at 14:53
    
Well but thats a huge fall in speed it more then double slower! I thought cdn serve the code through a server closest to the client? –  Chriswede Feb 11 '12 at 14:57
    
Also double check the strategy how you metric is correct. –  hakre Feb 11 '12 at 15:37
2  
Umm, am I missing something or is your test totally bunk? You're testing two different sites (codepigeon vs storyfollower), with different layouts and different total pages sizes... doesn't exactly seem like a good test of CDN speed... –  Ben D Feb 11 '12 at 18:21
1  
CDN is more faster for repeat delivery. Also, CDN is not faster than delivery from Memory of web server. –  Eric Yin Feb 12 '12 at 20:50
show 2 more comments

2 Answers 2

CloudFront should have pretty good performance. Despite the comments, CDNs are intended to increase speed, not just scalability. Otherwise, CDNs would be no different from a cloud storage platform like S3 that employs load-balancing.

Amazon specifically developed CloudFront for low latency and high transfer speeds—just as with pretty much all other content delivery networks. That's why it employs a range of edge locations across the globe. It's also why Amazon is surveying users for suggestions on new edge locations.

There could be a few different factors here, including:

  1. CloudFront's closest edge servers are farther away from your particular location than your web host.
  2. The additional DNS lookup is increasing TTFB. If you're using a custom origin server instead of S3, this could cause further delays on cache misses as the edge server has to do a DNS lookup of your origin server.
  3. Cache misses: if your file isn't found on the edge node, then it has to be pulled from the origin server. The longer your TTL and the more popular your site is, the less this effect will be felt by your users.
  4. The Edge node used is currently experiencing high loads.

Of course, there's no way to tell in your case since we don't know what the actual test results/conditions were. I do know that, even though CloudFront doesn't deliver as good of performance as the more expensive CDNs, most tests show very favorable results.

You need to actually look at the Pingdom results and see where the extra time is coming from. Is it from DNS lookup? Is it longer transfer times? Is it due to longer wait times? Is there maybe an extra redirect being performed on one test? Is there host sharding in one test? Is it a single blocking JS file that's causing the delay?

Links to the actual accurate tests would help in diagnosing the issue. Also keep in mind that CDN performance isn't measured based on a single page load or a single location. Perhaps the CDN will slow down performance for a particular location or when there are cache misses, but if it speeds up 99% of the other page loads, then it's still a net gain in performance.

share|improve this answer
    
Well actually they are archived: With cdn: tools.pingdom.com/fpt/#!/BmxPlstTp/storyfollower.com 1.7 sec Without cdn tools.pingdom.com/fpt/#!/nFmp4l3Ez/storyfollower.com 0.8 sec –  Jimbo Mombasa Feb 12 '12 at 22:43
add comment

Some time ago I began loading jquery an other libraries from Google CDN but I realized this is far slower than loading from the same server where my websites are running. So I came back to load from my hosting server.

So, I think (not sure though) CDN is a good solution for large website with A LOT of visits. So, the CDN will be faster than your small shared hosting.

share|improve this answer
    
btw, I'm using CloudFlare in almost all my sites, and it's a very good solution. You can try this solution instead of a CDN. And the regular version is free. –  Alex Angelico Feb 12 '12 at 22:25
    
Its already being used there ;) –  Jimbo Mombasa Feb 12 '12 at 22:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.