Boohoo, My Site is Down!! -- Got Capistrano?
Posted by Aaron Qian Thu, 26 Jun 2008 16:26:00 GMT
Servers DO Fail—Get Real
About three days after my failed attempt in persuading my contractor FooBy Company (for privacy reasons, the name is not real) to setup automatic deployment solutions for their rails online shopping service, I got a call from them and was informed that the website is down, and they can’t seems to get the site back up. I have just started working with them. Without the knowledge of the internals of the server structure, I ssh into their server(a little nervous), read their poorly written bash scripts, hack around. After about one and half hours of frustration, 2 server reboots, a dozen mongrel_rails cluster::start, a few undeleted pids, and countless French. I finally brought the site back from oblivion.
Total downtime: 3 hours 23 minutes…
A Better Solution Than French
Someone as smart as you might wonder, there must be a better solution to this. Yes, if you ask any creditable rails developer, usually you will get Capistrano.
As you probably already know, Capistrano is a automatic server deployment solution that ease the complexity of rails/merb deployment. You can find out more on their website.
How long does it take to setup Capistrano?
sudo gem install capistranocd /YOUR_APP_ROOT; capify .- and modify to your liking
mate config/deploy.rb cap deploy:setup- ssh into your server, create directories, create config files
cap deploy:cold
Setup time: 20 minutes.
Deployment time: 1minute. (Just run cap deploy)
Do it right => Do it fast
From my own experience in working with managers and CEOs, I have concluded some commonalities.
- Speed is everything.
- Short term benefit is always greater than long term benefits.
- We should do it right, but we should do it later, because it cost too much
- Don’t fix/change/optimize it if it works now.
- We know there are potential problems, let’s fix it when the problem arises
No No No!
Do it right, and do it once!!
Yes, aaron, I agree with you.
I agree Aaron. Actually, I couldn't agree more.
Aaron,
In a perfect world where there are no constraints on time and money, of course everything should be done once and done right.
In the real world, managers and CEO's are faced with balancing tradeoffs and that results in the 5 points you mention. Every time something is not done right the technical debt of the project increases. If that debt is not controlled, the project will most likely fail. I am a firm believer in the "Don't Live with Broken Windows" philosophy. It is the only way to manage technical debt.
You can read more about technical debt and the Broken Window Theory here http://www.artima.com/intv/fixit2.html