Thursday, June 30, 2011

The second most important metric - Location, Location, Location

You might think from the title "Location, location, location" this will be a post about real estate however in the new era of Cloud and Mobile Computing location is going to big a huge factor both for the design of your service as well as testing it and in particular performance.  Cloud Computing is a growing trend which is enabling all kinds of new applications.  If you want to find out more on Cloud Computing you can check our the slides from a talk I did at the Better Software Conference this year in Las Vegas here.

So why does location matter?  Location matters because of physics and no one has figured out how to out run the speed of light.  Ok... that is a little abstract so let me give an example.  Image you live in South Africa and want to deploy your cool new service in California because lots of Cloud providers have data centers there - superfast to do and cheap.  A single packet of data will take a half of a second to go from South Africa to California and back.  Thats how long it takes light to travel (roughly). Now image if your new site serves pages with images to fetch, database rows to read, etc.  Each new object you serve means the user (using a browser) in South Africa has to request data from California.  Each round trip is 0.5 seconds so a page with 10 images could take 5 to 10 seconds just is trying to initiate a fetch.  Wow... its not looking good for your service if you want people in South Africa to use it.

Some generally accepted time constrains for operations to happen are the following -
  • User interfaces should respond in around 100 millisec or less.  Human perception is around 30 millisec.
  • A user can detect a software hang in round one second and will take action at around 5 seconds to fix it.
  • The good news for the web is users are willing to wait up to 15 seconds for a page however they will likely never come back if it takes more than 30 seconds.
So now that you have seen deploying your new service in California for you South Africa users is not such a good idea what should you do?  The answer is to find zones closer to you like Europe or possibly Asia.  At the time of writing this I dont know of anyone providing Cloud resources directly in Africa however the landscape is changing quickly as demand rises.

Another example of how location matters is interactive games.  Image a multi-player games really popular on the East Coast of the US with all the game servers on the West Coast of the US.  In general a packet takes around 50 to 70 millsec to travel there an back.  This means a game can only get around 10 to 15 corrections a second.  These long latencies can show up in you shooting anther player first but for some reason you die.  Gamers hate this.

Given the growing dependence of cool applications on Cloud resources its time really start thinking about where your users are and where you services are located.  The shorter the physical distance the better.

Location also matter for legal and privacy issues however thats a whole topic onto itself.