Wednesday, 19 October 2011

Blogger + $3.74 VPS + Speedy Mirror CDN = Bliss


When I set about to get this blog ready, I had a few decisions to make.
I'd like to explain why I have made the decisions I have made.



Own Hosting vs Blogging Service

First off, I had to decide between own-hosting and service hosting. What do I mean by those terms? Simply put, this was whether I wanted to host the blog software with my own hardware/software or rely on a company for the maintenance of my blog.
I had previously tried hosting my own Wordpress blog and while maintenance was not too much of an issue and I was very happy, I quickly noticed that with greater freedom, I had the hassle of having too many choices. Among the many things I had to care about were:

  • Web server performance (inclusive of PHP performance) - Does my blog load up quickly enough? Does it cause too much load?
  • Reliability - Let's set up backups every hour just in case I need them. My server could burn, the hard drive could corrupt, anything could happen and the worst will always happen to my blog.

I found myself messing about with plugins and setting half of the time, adding this and that then eventually stripping most plugins out to increase performance.

With the previous experience in mind (as well as previous forum hosting etc), I decided that I wanted my blog to be hassle-free. Sure, setting up and tweaking web servers is fun. It's fun bragging about my knowledge in Nginx vs. Apache and similar topics as well as boasting how my system is relatively fast compared to someone else's billion-dollar setup. However, the point of having a blog is to blog! There are literally hundreds of companies out there, asking you to jump into their arms for hassle free blogging. There were a few options I had yet again.




Tumblr, I had tried out very briefly in its early days but I was soon frustrated by the lack of functionality and extreme emphasis on looks. Yes, this was not too much of an issue since afterall, the content and delivery of content is of utmost importance right?
Sadly, Tumblr failed to satisfy in those aspects.

This message could be seen almost daily
The above image was routine for my Tumblr blog and I quickly got fed up. I was not too much of a fan of the Twitter-like blogging system as well.



Wordpress.com was a likely choice after Tumblr. They seemed to be doing things well and with their hopping onto Nginx (my webserver of choice), I had more of a reason to move in right-away. There were a few hurdles and it did not seem likely that they would to be fixed or removed in the foreseeable future.
  • Custom domain support is not free.
  • Content is not deployed via CDN.
  • Caching configuration, backups etc is still user-side.
  • Wordpress is coded in PHP (elaborated on later).
You may be wondering: "You're getting it for free, you can't ask for too much!". It turns out I can.



Blogger is what I ended up going with. Being Google hosted meant that my blog would be maintained (for free) by the most skilled professionals and maintenance would be done well since publishers (bloggers) bring in revenue via AdSense. It also meant that my blog would be served as speedily as possible via Google's network of servers which far outperform any CDN service.

Another decision-making fact was that Blogger is coded by Google. This means that the software consists mainly of C++ and Python in the back-end. Having stayed with a friend who is a Python fanatic as well as a Google intern, I had been affected and had started caring about the language used to write back-end softwares. (Not that I will be able to poke through the source-code.)



$3.74 VPS + Speedy Mirror CDN

While setting my Blogger blog up with my personal domain, I noticed an interesting feature which only Google engineers would be kind enough to include, a "missing files host". This feature basically allows one to have files hosted on the blog domain as Blogger will redirect requests to the missing files host if the requested static file does not exist on the blog.

Currently not working in the new interface, to set a missing files host you must switch to the old interface

While setting this feature up required me to switch away from the new glittering interface, I was impressed by the fact that it was being offered and was also glad since it was exactly what I had hoped for but not looked for. If I had wanted an equivalent feature, I would have had to setup a try_files entry in my Nginx server, making people go through my small VPS in Chicago in order to access my site.

With one of the few 1gbps bandwidth budget VPSes provided by host90.com serving my files, I could have all the features of a 'perfect' setup with a monthly cost of $3.74! (It had to be 1gbps bandwidth. No, I do not have a few million requests per second but yes, do I obsess about performance...)

While thinking about ways to increase performance, I decided that I needed a good CDN service. This was because most of my latency was coming from the SyntaxHighlighter files hosted on my VPS that I was using to highlight code as I did in my Oneiric Ocelot upgrade experience post. A brief search gave me quite a few CDN services I could make use of but many were costly for a small blog like mine.

The service I settled for, Speedy Mirror provides 5GB of free CDN traffic for new users and lets you top-up for reasonable prices. I decided to settle for Speedy Mirror as I concluded that the free traffic would not compromise their performance. This is because of their reasonably priced upgrades. A few clicks with their simple interface and I was set. I had the following setup:

  • Missing Files Host - http://cdn.swook.net/
  • http://files.swook.net/ serving my files from my VPS
  • A CNAME entry for cdn.swook.net pointing towards swookfiles.speedymirror.com.




The Future

Most likely, I will find some aspect of my blog that I do not quite like but for now, with a monthly operating cost of $3.74 (ignoring domain, future CDN costs) I cannot be more content.

If you are just starting a blog like myself, I recommend my current setup. You do not even need a VPS actually, you could go with a free webhost such as 000webhost.com or x10hosting since your CDN is the one serving files and will do so swiftly (apart from the first 'Pull'er who has to wait for the CDN to pull files from the origin server). What I am saying is that you can have one of the fastest blogs in the world with minimal or no cost.

I guess the next step will be to populate this blog with as much content as possible.
Happy Blogging!