Tuesday, February 19, 2013

Amazon for static websites


Although my experience with Amazon AWS has mostly been with 100+ EC2 VPC instances, elastic load balancers, and multi-zoned RDS extra large instances - it does not have to be such an expensive endeavor to get the scale and reliability of AWS.

I recently helped a friend increase his website's performance and reduce his cost of hosting. I helped switched him from a slow $100/year wordpress shared service to an approximately 60 cents per month Amazons S3 with Cloudfront solution.

He started with Wordpress because the intent was to be more dynamic however that was not the case (his updates were more than often in facebook than on the static web site). The site is mainly so he can show clients his awesome ski, snowboarding and fly fishing expertise in the Telluride area. Also, the shared Wordpress site was taking up to 11 seconds to deliver the HTML page (not cool for a website in 2013).

Amazon recently introduced the ability to serve static HTML directly from S3. The process involved dumping the Wordpress site to HTML/CSS/JS/images and then uploading it S3. We first tried a few plugins like really static (however because the Wordpress site was so slow - this was taking forever and some required extensions were not on the hosted server). So we used a much more crude approach (aka command line):

mkdir pancho
cd pancho
wget -k -K  -E -r -l 10 -p -N -F --restrict-file-names=windows -nH http://www.panchowinter.com

This then dumped all the html, images and supporting files to a 'pancho' folder and then we s3sync'ed them up to Amazon:

cd ..
s3sync -p -r pancho/ www.panchowinter.com:

(-r for recursive and -p to make them public).

To get cloudfront working, I created a distribution pointed to his site and then did a search and replace to serve any static content from the cloudfront distribution.



We set the s3 bucket www.panchowinter.com for static upload and index.html as the index document:


Then created a panchowinter.com bucket that forwarded to www.panchowinter.com:



We also moved the DNS to Route 53 and pointed alias record to the hosted S3 buckets:

and



The end result was page load times not in seconds (2.72):


But rather now in miliseconds (122):


Also thanks to cloudfront the supporting files are often less than 100ms. 



Thursday, February 14, 2013

Technology while skiing

Top speed skiers can reach 200km/h regularly. However, after just reaching 91km/h it seemed fast enough for me. This was done on a freshly groomed double blue run. There is a groomed black run here, but the end of it merges with another run and levels off quickly (which makes me worry that the G force will push me too far into my skis and pop my bindings (aka loose a ski or two and thus be falling down the hill out of control).

However, it has been a good place to play with technology. Here is a quick summary of some of the electronic toys I have experimented with in Telluride, CO this season.

The above app tracks your motion, and records your speed, altitude and even factors in ski lifts. It will take photos but the last think you want to do is take out your smart phone on a cold windy or snowy day. I have a Contour HD external camera for that.

I also just played with the Recon HUD system. It gave me eye strain but the heads up display was neat. Unfortunately it only would pair with an iPhone 4S (not my 4) so I was not able to test out the smart phone integration. Because of this, and the fact that the ski tracks app in my iphone already tracked my runs, and that it would not fit right into my goggles - I ended up returning it.

I do have speakers in my helmet with a built in microphone. It is great for listening to music or an audio book - but with poor mountain reception and wind noise you can't have any serious phone calls.