Monday, September 12, 2011

Magento on Rackspace Cloud - Update

At the beginning of the year, I posted about my experience running Magento on the Rackspace cloud infrastructure.  The gist of that post was that Magento does in fact run quite well, as long as you use a minimum of the 2GB instance provided by Rackspace.  (Original Article Here)

Since then, I have been migrating several sites to this infrastructure.  Initially, I figured it would be easy to put 5 or even 10 sites on one instance, and scale it up to 8GB or 16GB or whatever was needed.  Vertical scale with a single cloud server appeared to be a quick and simple deployment plan.  Unfortunately, this all came crashing down on me when I went to add the sixth site.

Rackspace kindly informed me that they could only assign a total of 5 IP addresses to a single CloudServer instance.  This really makes no sense to me, since I can get 5 more just by adding another server, but that's their policy anyway.

In case you didn't know, every site that has its own SSL certificate requires its own dedicated IP address.  This includes all of the Magento sites that we currently manage at 4word systems.

Forced to deal with the reality of spinning up several 2GB+ instances to support a larger number of sites, I got to thinking about my original strategy.  After all, to keep on the planned path would turn out to be expensive as hell.

What if I offloaded the database activity to a separate server?  How might that impact the performance / hardware requirements for the web server?  How big would the DB server need to be?

Through a good amount of trial-and-error I have discovered the following (so far).

1:  The database server can be surprisingly small if properly tuned.  MySQL database tuning and maintenance can be a tricky thing, but currently I am supporting around 10 Magento databases on a 1GB CloudServer instance with no performance problems whatsoever.  I will again mention that this absolutely requires a well-tuned MySQL installation.

2:  The web server size requirement also drops considerably.  Previously, I had a single Magento site that was so busy most of the time, I needed to upgrade from 2GB to 4GB to prevent heavy swapping to disk.  After offloading the database to the new 1GB instance, I was able to reduce the web instance from 4GB to 1GB.  This is a remarkable improvement.  2 servers at 1GB is half the cost of a single 4GB instance, and the 1GB database server is able to service at least 9 more websites.

The long and short of it is this:  If you plan to host Magento on CloudServers, do yourself (and your budget) a favour.  Split the database on to a different server.  Even if you are only managing a single site, you will get more performance for less money any way you cut it.

Friday, September 9, 2011

Mass Transit in America - Time for a New Dawn

The history of this country is rich with ambitious, nationwide transportation projects.  One might argue that transportation has enabled much of the growth that has fuelled the rise of the US as a global superpower.  Transporting materials, supplies, finished goods and people across the nation with speed and efficiency is a hallmark of American accomplishment.

Sadly, with the completion of the interstate highway system in 1992 (at a cost of 4x the original estimate and 3x longer than planned) transportation has taken a vacation when it comes to public policy.

The World Has Changed
A lot has changed since 1956, when the Federal Aid Highway Act was written.  Smog, congestion, oil-dependency and highway fatalities are a fact of life now for virtually every American.  While the highway system accomplished it's grand objective, the consequences can not be ignored.  Each day, tens of millions of people wake up, get in their cars, and waste an average of an hour each day driving to and from their place of employment.  Risking life and limb, the gainfully employed venture out onto the interstate highway system so they can afford to pay for the vehicles and fuel that make it possible for them to do the same thing the next day.

Count the Cost
With the average price of a new vehicle hovering around $30,000, few Americans can afford to directly purchase a new car.  Instead they turn to the benevolent finance companies (aka banks) who will ensure that the actual cost will nearly double.  Given that a car typically will be out of warranty within 3 years and nearly worthless after 10, it's not unusual for the capital cost of a vehicle to come to $7,000 - $8,000 per year.

Add on the compulsory insurance coverage for another $750 or so per year.

With the average round-trip commute at 32 miles per day, an average fuel economy of 25 MPG, we add another $1,200 - $1,300 per year in fuel alone.

Add to that the cost of regular scheduled maintenance, tires, brakes and repairs, it's easy to see that operating a car solely for the purpose of getting to work can easily run $9,000 - $11,000 per year.

News Flash: For nearly 1/2 of American households, that represents 20% or more of total pre-tax income.  When you look at after-tax income, vehicle expenses can easily exceed 30% of the average family's take-home pay. 

I'm convinced most people don't see that.  We've been conditioned not to.  Advertising works, people.

Oh, and that's before we even consider the more than 250 hours each year lost by the average commuter on their way to and from work.  At an average rate of $25 / hour, there's another $6250 down the drain.

It's time for change.  I thought that's why we hired this guy for President. . .