While this blog does not receive tons of traffic, I still run it so that it could handle a ton of traffic. This means leveraging CDN or Content Delivery Network technology. There are a number of providers who offer this, but Windows Azure and Amazon S3/Cloudfront are two of the best and cheapest. There are higher performance options like Mirror Image and Akamai, as well as poor-man solutions like GoDaddy or Rackspace server hosting. Akamai is pretty pricey. Mirror Image used to be about $100/mo. I can’t see why anyone would use GoDaddy when Amazon and Microsoft practically give away high quality bandwidth for CDN hosting and have a huge footprint.
The motivation for me was that the author of the Azure CDN plugin had stopped developing it a couple of years ago. As WordPress moved forward I realized I was having some image issues and finding that my images were going to multiple places. I also had installed a couple of plugins for Amazon that did the heavy lifting of synching files. This was a great opportunity to untangle the issue and clean up my hosting costs.
I used Cloudberry’s free tool for Azure Blob Explorer and S3 Explorer to access and see what was in the buckets. They are two separate tools, but they are quick and free. I then copied the content down to my local drive so I could consolidate it. Then using WinSCP I copied the content back up to my home directory on the server. From there I copied it recursively over to the virtual host directory in var/www. Then I reset the ownership and permsisions. This gave me a clean and complete set of files. From here I was able to remove the conflicting and outdated plugins. I then used Blue Velvet’s URL renamer plugin to point everything at my main URL. This allows wp-super cache to work most effectively.
I then deleted the Azure Blob after verifying it was no longer being used. This will save me a $1/mo or something silly like that. Azure CDN had comparable performance to S3. I considered putting the origin-pull CDN on Azure, but it’s a pain to configure. The actual setup is fast. Amazon gives you lots of control, Azure just sets up a basic no-frills no-control CDN. This is a recurring theme with Azure and AWS. And of course Microsoft has their head in the sand when it comes to configuring DNS on their hosting objects. In the name of security they insist that you make some funky DNS entries to verify ownership. You have to do this for every single DNS entry you want to map. What a PITA! Both CDN’s do similar things… Amazon’s just requires more up-front planning and provisions in 15 minutes. Microsoft gives you fewer choices up-front, but takes an hour to provision. Hmmmm.
Next I turned my attention Amazon. I deleted my existing Cloudfront distribution. Cloudfront is Amazon’s CDN Product. Pricing is cheap and performance is stunning. One of it’s few limitations is only allowing a URL in one distribution at a time. So this means deleting the outgoing one and creating a new one. The old one was tied to an S3 bucket. Amazon S3 is the Simple Storage Service which is Amazon’s drive in the cloud and one of the older cloud services. Once the distribution was down I was able to create a new one with a setting called origin-pull. This means that when the file is requested Amazon will fetch it from the server if they don’t already have it. If they do have it they will check to see if it’s been updated before serving it. This eliminates the need to push files to S3 and reduces S3 storage costs to a minimum.
Once I confirmed that it was setup properly I was able to retire the S3 bucket. This will help get me to a mean lean hosting state that minimizes costs.