Archive

Posts Tagged ‘cdn’

CloudFlare free cdn service

October 19th, 2010

CloudFlare is a new cloud service which provides free website security and caching. A quick test revealed that it uses anycast geodns technology with nginx reverse caching.

The setup process is very easy. You only need to change DNS server from domain registry. Setup wizard will automatically import old DNS setting. However multi tiered sub domain won’t be detected. Both CNAME and A host will be proxyed through by default.

Once DNS change finished, your website will be severed with transparent proxies. Unwanted visitor will be screened and static assets will be cached.


Here is the page loading timeline of my test page
Without CloudFlare
Without CloudFlare
With CloudFlare
With CloudFlare
The page is very simple, but still it clearly shows there’s no measurable latency with dynamic contents and notable improvement with static assets. However text assets like html, css and js have slightly bigger size. My original is compressed with gzip -9.

Pro:

  • Anycast GeoDNS hosting
  • Vistor security screen
  • Slick analytics
  • Transparent caching around world
  • Basic account is free
  • Very easy to setup

Con:

  • Http only, no video streaming
  • Slow in Asia
  • Suboptimal gzip compression ratio

Overall I am very impressed with the free features and performance.

Bookmark and Share  
 

Yejun Web , ,

CDN Latency Compared

March 21st, 2009

I compared some puplar commercial CDN’s global latency by using just-ping.

The raw test result you can downloaded from here.

Result Summary:

.

Network Average Median

.

Akamai 9.67 2.9

.

Aol CDN 9.22 4

.

Panthercdn 62.36 12.7

.

LimeLight 58.04 13.2

.

Mosso Cloud Files 56.81 13.5

.

Amazon Cloudfront 62.82 18.6

.

Google Homepage 53.53 23.15

.

Cachefly 54.57 28.2

.

Google Ajax Library 54.96 28.5

.

Homemade CDN 76.31 29

.

Yahoo Homepage 82.77 38.4

.

Google App Engine 76.03 42.8

.

US East 130.11 96.9

.

SimpleCDN 142.84 100.8

.

US West 156.32 165.4

Chart:

CDN Latency Comparison

Notes:

  1. Akamai
  2. Aol CDN is served by Akamai
  3. Panther Express
  4. Limelight Networks
  5. Mosso is served by Limelight
  6. Amazon CloudFront Images on this page are served by CloudFront
  7. Google
  8. CacheFly
  9. Google AJAX Libraries
  10. This page is served by my own homemade CDN, you can test speed here
  11. Yahoo
  12. Google App Engine
  13. Single location ip in New Jersey USA listed here for comparison purpose
  14. SimpleCDN
  15. Single location ip in California USA listed here for comparison purpose

Disclamer: I am not affiliated to any company mentioned above. Nor do I endorse the accuracy of these results.

Bookmark and Share  
 

Yejun Web , , , , ,

Cloud files uploading script

March 13th, 2009

This is a very simple linux bash script to help uploading files to mosso cloud files.

Mosso uploading script: Mosso.sh
Updates: Here is a Mac OSX Version (provided by Bryan Rehbein)

You will also need curl .

After you sign up mosso cloud files service, first you need to login your mosso cloud files control panel then navigate to Your Account / API Access, where you will generate your API key. Edit the begin of mosso.sh

API_KEY=YOURAPIKEYHERE 
USER=yourusername 
CONTAINER=bucket

Now change to the directory where you want to upload files. e.g. a wordpress installation:

cd /srv/http/wordpress
bash mosso.sh wp-includes/js/jquery
Uploading wp-includes/js/jquery/jquery.table-hotkeys.js .... done.
Uploading wp-includes/js/jquery/interface.js .... done.
Uploading wp-includes/js/jquery/ui.core.js .... done.
Uploading wp-includes/js/jquery/jquery.color.js .... done.
Uploading wp-includes/js/jquery/ui.tabs.js .... done.
Uploading wp-includes/js/jquery/ui.resizable.js .... done.
Uploading wp-includes/js/jquery/jquery.hotkeys.js .... done.
Uploading wp-includes/js/jquery/ui.sortable.js .... done.
Uploading wp-includes/js/jquery/ui.dialog.js .... done.
Uploading wp-includes/js/jquery/jquery.js .... done.
Uploading wp-includes/js/jquery/ui.draggable.js .... done.
Uploading wp-includes/js/jquery/jquery.form.js .... done.
Uploading wp-includes/js/jquery/suggest.js .... done.
Uploading wp-includes/js/jquery/jquery.schedule.js .... done.
HTTP/1.1 202 Accepted
Date: Sat, 14 Mar 2009 00:06:41 GMT
Server: Apache
X-CDN-URI: http://cdn.cloudfiles.mosso.com/c12345
Content-Length: 0
Content-Type: text/plain; charset=UTF-8

Write down the url on the line begn with X-CDN-URI. This is your mosso CDN url. You can also find this url inside your mosso control panel.

If you want to upload entire current directory, you can execute this script without argument.

Bookmark and Share  
 

Yejun Linux, Web , , , ,

New CDN service

March 13th, 2009

Mosso’s new CDN service cost $0.22 per GB.

http://blog.mosso.com/2009/03/cloud-files-emerges/  

Updates:

Some simple tests show mosso cdn is just as fast as amazon cloud front. I offloaded some of my blog’s static image to mosso cloud files.

Pagetest  shows about 10% overall page loading time improvement.

I also wrote a simple bash script to help copying files. It seems mosso does not support gzip encoding yet, nor does cname support.

Some test result:

Pagetest from New Zealand:

New Zealand Waterfall

New Zealand Waterfall

 

New Zealand Connection

New Zealand Connection

Pagetest from VA USA:

 

VA USA

VA USA Waterfall

VA USA Connection

VA USA Connection

Bookmark and Share  
 

Yejun Uncategorized ,

I wrote a WP plugin

February 24th, 2009

I wrote my first WordPress plugin which will help rewriting js, css and theme file’s url to your own CDN network. So you don’t have to hack wordpress files.

You can download it here.

Bookmark and Share  
 

Yejun Web , ,

How to use SimpleCDN with WordPress

February 15th, 2009

Update 2/24/2009: This method is deprecated. I wrote a plugin to rewite urls.
Update again: SimpleCDN is slower comparing to CloudFront, I moved all my link to CF. If you have problem copying files to S3, you can read this post.

WordPress is my favorite bloging software, with many builtin features and powerful plugins. WordPress.com, the blogging platform by automattic, has been using CDN for a long time. However there is no public available solution to make self hosted WordPress to use a CDN as well. Fortunately the php code itself is very clean to read, so it took me about 5 minutes to find where I should modify to fully integrate my new CDN address.

Before you proceed, please read my previous posts on how to use CNAME with SimpleCDN and how to process javascript and css files for WordPress. Make sure your SimpleCDN’s CNAME and bucket working properly. I used a mirror bucket which points to my blog address, that is probably the simplest way to mirror your static assets. And use ‘-s1′ pre-url to insure client side cache working, because SimpleCDN does not use 304 not modified http header at all. I used bucket name ’s.mudy.info’ for my own blog.

Once your DNS full propagated, open your favorite text editor open following 3 files.

wp-includes/class.wp-scripts.php‘: near line 75, change

$src = $this->base_url . $src;

to

$src = 'http://yourcdnbucketname' . $src;

There is no trailing slash after your bucketname. If you want to make sure client browser always use cached version, you can also comments out the following line.

// $src = add_query_arg('ver', $ver, $src);

But this change may break WordPress upgrade.

wp-include/class.wp-styles.php‘: near line 79, do the same change as above.

wp-include/theme.php‘: near line 504, change

return apply_filters('theme_root_uri', content_url('themes'), get_option('siteurl'));

to

return 'http://yourcdnbucketname/wp-content/themes';

That’s it. Now clean your cache and test your blog.

Bookmark and Share  
 

Yejun Web , , ,