Why your boss will love Capistrano
Hopefully, you have some kind of measures in place that alert you to the fact that you need a new server. If you don’t even have this, that stinking whale just might be your job floating right out from underneath you. Stop! Do not pass “Go!” and proceed directly to Munin! Knowing the usual loads (and growth over time) is critical in being able to plan your infrastructure.
Ok, so you (and the marketing team) have noticed a nicely growing trend in traffic over the last few months. SEO and performance optimizations are working together to drive traffic to your site and keep it there. Grab a pen and continue the curve on this database queries per second graph below:
You better order some servers! Note: yes, I know you should first ensure your query caching parameters have been tweaked and your application isn’t making unnecessary requests…but that’s another blog post .
So, you contact your hosting provider and ask for a quote. A few days later, you get your quote and discuss with management on when/how many to order. A week later, you’ve filled out the order form and faxed it off. I’ll be generous here and say this whole process took a week (even though its closer to two). You’ll find out why in a bit.
Let’s make another assumption and say your servers are completely managed – this means you don’t have physical access to them and the new ones just sort of “pop” into existence in your network. If you took physical delivery, it probably means you’ll have to install even the OS yourself, configure RAID arrays, etc. adding up to a month in work (and lost time). But, again, let’s be a bit more 21st century here. Your hoster promised your new servers would be ready for use in two weeks, and, luckily you get them as promised. We’re now at 3 weeks and you’re staring at a couple of empty terminal shells now.
How long it takes to install your application on a new server depends on a lot of factors. How complex is it (how many moving parts does it have)? Trivial applications take about a day to fully configure, test & deploy. Bigger beasts might take up to a week.
Experience is another big factor in your setup time. How often have you done this before? Is it your first time? Probably means you don’t fully have a grasp on your application (and all its dependencies). You’ll need a week. Do you do this every month? Should be a breeze then: 1 day. Let’s go with the average and err this time on the conversative side: 1 week total installation, deployment & testing time.
Congratulations! 4 weeks after you’ve identified the need for additional capacity, you now have it. Unfortunately, neither your website nor your users have been patient during the last month. This is obviously not going to get you a promotion, but definitely cost you some traffic.
Enter the “Cloud” – that nebulous, silver-lined wonder of infinite scaleability. Amazon’s EC2 cloud cuts the requisition time of the order & delivery stages down from 3 weeks to just minutes. This is already a 75% savings in deployment time! But, without automated deployment, you’ll still need a week to get your application installed.
Ok, so I finally mentioned “automated deployment”. It’s basically about automating the entire install, test & deploy phase above. Over at NetDoktor we use Capistrano to accomplish this truly magical feat. What used to take me an entire day, now takes anyone a few minutes. And that 4 weeks timeframe above? Now less than 10 minutes. This gives your business an incredible flexibility to instantly meet the demands of your customers, traffic spikes, and overall growth.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)