Always Get Better

Never stop looking for ways to improve

November 14th, 2010

Awhile ago I wrote about how I was using nginx to serve static files rather than letting the more memory-intensive Apache handle the load for files that don’t need its processing capabilities. The basic premise is that nginx is the web-facing daemon and handles static files directly from the file system, while shipping any other request off to Apache on another port.

What if Apache is on a different server entirely? Unless you have the luxury of an NAS device, your options are:

1. Maintain a copy of the site’s assets separate from the web site
There are two problems with this approach: maintainability, and synchronization. You’ll have to remember to deploy any content changes separately to the rest of the site, which is counter-intuitive and opens up your process to human error. User-generated content stays on the Apache server and would be inaccessible to nginx.

2. Use a replicating network file system like GlusterFS
Network-based replication systems are advanced and provide amazing redundancy. Any changes you make to one server can be replicated to the others very quickly, so any user generated content will be available to your content servers, and you only have to deploy your web site once.

The downside is that many NFS solutions are optimized for larger (>50Mb) filesizes. If you rely on your content server for small files (images, css, js), the read performance may decline when your traffic numbers increase. For high availability systems where it is critical for each server to have a full set of up-to-date files, this is probably the best solution.

3. Use an rsync-based solution
This is the method I’ve chosen to look at here. It’s important that my content server is updated as fast as possible, and I would like to know that when I perform disaster recovery or make backups of my web site the files will be reasonably up to date. If a single file takes a few seconds to appear on any of my servers, it isn’t a huge deal (I’m just running WordPress).

The Delivery Mechanism
rsync is fast and installed by default on most servers. Pair it with ssh and use password-less login keys, and you have an easy solution for script-able file replication. The only missing piece is the “trigger” – whenever the filesystem is updated, we need to run our update script in order to replicate to our content server.

Icrond is one possible solution – whenever a directory is updated icrond can run our update script. The problem here is that service does not act upon file updates recursively. fsniper is our solution.

The process flow should look like this.
1. When the content directory is updated (via site upload or user file upload), fsniper initiates our update script.
2. Update script connects to the content server via ssh, and issues an rsync command between our content directory and the server’s content directory.
3. Hourly (or whatever), initiate an rsync command from the content server to any web servers – this will keep all the nodes fairly up-to-date for backup and disaster recovery purposes.

November 16th, 2009
Victory!
Creative Commons License photo credit: quinn.anya

Chris Guillebeau offers his e-book 279 Days to Overnight Success for free on his blog. This is a great piece of writing that debunks the popular myths about “making it” blogging.

  1. Don’t rely on Google/Adsense as a “get-rich-quick” vehicle – they aren’t
  2. You don’t need millions of visitors and command of Digg to do well
  3. You will have to work hard
  4. Overnight success means ‘months or years’, not ‘days’

See for yourself – download it today.

November 10th, 2009

It seems like correcting Seth Godin is a favourite pastime enjoyed by folks online. Sorry to break from the group, but I happen to think he is a deep well of relevant information.

This week he brought up the idea of upsides versus downsides – how much effort do businesses put into minimizing their downside versus the time they put into offering the best user experience?

One of the primary examples from the post is that of a hospital spending a huge amount of time doing paperwork to prevent litigation and prevent people from getting worse when their primary goal (and reason for existing) should be improving the lives of the patients coming through their doors.

The hospital example was interesting and timely because in “real life” the Jewish General Hospital recently came out and said it has been able to improve patient care (upside) by reducing errors (downside) through its new(ish) full disclosure policy. This ties in nicely with Seth’s article because it proves that it is possible for even large organizations to let go of the status quo and achieve new levels of excellence.

In the case of the Jewish General Hospital, it seems paradoxical but by admitting and dealing with errors, the hospital is actually less likely to be sued and face costly litigation. In essence, they have found a way to improve patient care, cut costs, and foster an open corporate culture. Way to go!

August 31st, 2009
Bureaucracy illustration
Creative Commons License photo credit: Kongharald

Don’t worry folks, I haven’t disappeared. I’ve been buried under a mountain of RSS. One of the disadvantages of trying to stay informed about absolutely everything is that if you take just a few days away from the newsfeeds you will fall way behind.

Google Reader makes it extra easy to lose interesting posts when you scan too fast. I still prefer it over all other software I’ve tried so far.

June 26th, 2009

I have to admit, reading Valleywag was a bit of a guilty pleasure. The online publication, which was part of Gawker Media, is akin to the tech world’s Perez Hilton. Gossip about silicon’s celebrities is dished up daily and served to geeks’ RSS feeds everywhere.

Valleywag was folded in 2008 and became a column in the overall Gawker site. Too bad… it was fun to see people get so upset over its (essentially tabloid) articles.

The main criticism people had of Valleywag was its willingness to publish unverified gossip in order to be the first to break developing stories. In Valleywag’s defense, the stories weren’t presented as fact, the magazine disclosed that it was operating on unverified rumour, and it was quick to update as new information became available.

That said, the wider issue is that a publication of Valleywag’s size and reach has a responsibility to get its information right the first time because the majority of its readers do not come back to check the updated status of new items – they expect to have already received the full story. The irony here is that the very thing that made Valleywag popular – the speed at which it spread its gossip – is what is was most criticized for.

June 19th, 2009

LimitlessUnits.com is an interesting little blog that shares many of my own morals. I wish Tony updated more but the posts he puts up are always thoughtful and fleshed out. Design-wise the site is simple in an elegant and usable way. If programming and video games are up your alley, go on over and subscribe.

June 12th, 2009

I’ve decided to start using Fridays to reflect on the state of my RSS reader. Starting on Friday of next week I plan to showcase blogs that I think are well written, technically marvelous, or just plain cool.

Please feel welcome to contact me if you’d like to share your own site, or one that you think is worth checking out. The genre is unimportant – I’m looking to fill my feed with as much great content as I possibly can.