Moving On Up To The Cloud

For the last year I’ve been hosting this site on a server running in my basement. While it’s been a much better experience than the $6/month, ‘everything included’, shared hosting plan I was on before, this setup has had its own set of problems. For starters, cable internet is not a viable way to host web sites. Even with a commercial grade, unshared, 10/1Mbps connection the response time to my site was quite high and fluctuated wildly. To make matters worse, we apparently live in a neighborhood that doesn’t have much redundancy on the local power grid – we’ve have numerous power outages in the year we’ve lived here.

While this might be acceptable for a simple blog, I recently started hosting a few sites for others, including our local .NET Users Group and a neighbor’s business site, and the performance and uptime bar needed to be cranked up a bit. I needed something that was on a good, solid internet connection, gave me plenty of control, and was priced low enough to address the wife acceptance factor.

My new home: The Rackspace Cloud

After considering a variety of options, I finally settled on Rackspace’s Cloud Servers. I’d been tinkering with their services for some time and had been very impressed not only by the performance and capabilities, but by the price. For as little as $11 per month you can run your very own virtual Linux server with 256MB of RAM and 10GB of disk space. Need Windows servers? They start at about $29 per month for 512MB of RAM and 20GB of disk space. Need some short-term servers to handle capacity? You pay by the hour and there are no minimums or commitments! Their control panel is incredibly easy to use, and for more advanced scenarios there’s even an API for automatically scaling up and down. I could go on, but instead I’m going to recommend an excellent review at Social Cloud Now.

For my little setup I went with 2 Ubuntu servers and 1 Windows server – total damage is just over $50/month. This gives me an Apache web server, an IIS web server, and keep the database on its own machine. How does it perform? I think my Pingdom response time report says it all.

Pingdom 

Moving up to the Rackspace cloud has cut my response time in half! Before the move my response time averaged close to 800ms, after it’s under 400ms (the brief spike was after I had migrated the database to the cloud but before I had migrated the web server). Those are the worldwide numbers – the US average is only 170ms!

A perfect fit

I couldn’t be happier with my move to the Rackspace cloud. Having great performance and availability, being easy to use, and affordably priced makes Rackspace my cloud provider of choice.

Speed Up The ASP.NET Development Server

Visual Studio has had a built-in web server for years, but I’m apparently one of the few developers that still prefers IIS. Why? It’s certainly not more convenient – you have to setup a virtual directory, file system permissions, and change the debugging options. It’s because on a modern Windows OS (Vista or newer) it is so slooooooooow!

Take a look at the following Firebug stats:

Sloooooooooow

There is literally no content on this page yet. I’ve got two static resources coming from the site, and I’m using the Google AJAX loader to pull in jQuery and the Maps API. Yet while even the slowest resource from Google takes a scant 144ms to load, the page and resources I’m pulling from my local machine are each taking just over a second!

Further testing showed that where Firefox and Chrome both exhibit this behavior, IE8 did not (or at least not by my seat-of-the-pants testing – the IE developer tools still don’t have a network profiler). Even stranger is that if I connect using 127.0.0.1 or localhost. (notice the trailing .) things improved!

Something isn’t right here.

The Culprit: IPv6 and DNS

With Windows Vista, Microsoft included the IPv6 networking stack by default. Under Windows 7 (and probably Vista) they’ve apparently left resolution of localhost up to DNS. As far as I can tell the slowness isn’t the browsers’ fault, but rather the system trying to resolve localhost using IPv6.

Fortunately the fix is easy. Fire up Notepad (or your text editor of choice) as an Administrator, and open up your system’s hosts file (typically C:\Windows\System32\drivers\etc\hosts). You should see that all entries are commented out. Simply uncomment (remove the #) from the IPv4 localhost entry only, save the file, and restart your browser.

hosts

Once this is done, things look much, much better when using Visual Studio’s development server. As we’d expect, the local resources are significantly faster than the external ones.

Fast

Don’t Get Mad, Get Better

I had seen this flash by yesterday, but today the story has hit mainstream. Apparently at yesterday’s Microsoft company meeting Steve Ballmer tormented an employee who was brandishing an iPhone. Should that employee have been a little more discreet in Ballmer’s presence? Maybe. Did Ballmer overreact? Probably. Should employees feel pressured to use only their company’s products? Absolutely not. Their company should make products that their employees want to use!

Don’t get caught with your pants down

Full disclosure: I am a BlackBerry user on Verizon. I live in Montana, where AT&T just doesn’t exist. Maybe they think there’s nothing here but cows?

In 2007 Apple turned the mobile industry upside-down when it introduced the iPhone. Never before had any phone offered so many easy to use features to consumers, and we ate it up. Before the iPhone smart phones were pretty much exclusively for business people and choices were limited, Windows Mobile or BlackBerry. Within months we were seeing phones being touted as iPhone ‘killers’, but that was far, far, far from reality.

More than two years have passed and there still isn’t anything even close. Many have tried and fallen short. Some of those have actually been really good phones, but still no iPhone. Why not? I’m certain that there are lots of incredibly smart people working at Nokia, LG, HTC, etc. We have Windows Mobile and Android operating systems that can run on many devices. How is it that the iPhone has gone so long unchallenged? Surely those in the mobile industry had known that something was coming from Apple, even if they didn’t know what. Yet that sat idly by churning out one generic phone after another. They had become complacent. A newcomer to the industry couldn’t possibly offer any significant competition, right?

Wrong. Apple has claimed about 13% of the smart phone market in just over two years, while Microsoft’s is sliding down past 9%.

You can’t really blame Ballmer for disliking the iPhone so much. Apple’s success has come at the expense of Microsoft and others, who were now scrambling to get something to market as quickly as possible. This marked the beginning of the cycles where just as soon as anyone gets remotely close to a comparable device Apple would release a new iPhone.

It didn’t take long to see that the iPhone was going to start running away with the market. At its launch it was the most expensive mobile device you could buy, but that didn’t stop thousands of people from camping out to get one. The day Steve Jobs announced the iPhone the Windows Mobile team should have put everything on hold to start planning its return strike. Each and every one of them should have been in those lines to get an iPhone so that they could really understand what made it so great. Only then could they really design a device worthy to be called a competitor. But they didn’t, and now they are playing catch-up.

Never stop getting better

This story applies to a broad range of industries, with software development absolutely being one of them. It’s relatively easy and inexpensive to take an idea and turn it into reality.it’s one of the reasons I enjoy what I do so much. But in an industry that can move so quickly you simply can not afford to let your guard down. To stay in the lead you’ve got to innovate in your product, or someone else will. If you become complacent you will get overtaken. And in the event that you do get your ass handed to you, don’t even think about getting mad.just get better.

Setting Up Google Analytics For Your Bitbucket Repositories

One cool feature of Bitbucket is the ability to track traffic to your repositories using Google Analytics. Setting it up is simple, but there are a few subtle tricks. Here’s how to do it.

  1. From your main Google Analytics screen, click “Add Website Profile” at the bottom of the screen.
  2. If this is the first repository you’ve setup, select the option to add a profile for a new domain. Once you’ve done this for one of your repositories you can use the existing domain option.
  3. In the URL field, enter “http://bitbucket.org”.it won’t let you enter the full URL of your repository here.
  4. Click “Finish”, which should take you back to the main Google Analytics screen.
  5. Find your analytics key for Bitbucket (i.e. UA-123456-7) and copy it.
  6. Go to the “Admin” page of your repository and paste the analytics key in the appropriate field.
  7. Head back to Google Analytics and click “Edit” on your newly created profile to bring up its settings.
  8. Under the “Main Website Profile” click “Edit” and paste the full URL of the repository in the “Website URL” field.
  9. It might take a few minutes, but the status of the tracking code should change from “Tracking Unknown” to “Waiting for Data”, and eventually to “Receiving Data”.

Now you are able to have some valuable insight into traffic reaching your repositories!

WordPress Gotcha: Upload Path After Migration

I recently moved a few web sites running WordPress from an Ubuntu host to a Windows Server 2008 host and have spent the last few hours trying to figure out why I couldn’t upload pictures through Windows Live Writer. Once I got past a recent upgrade bug everything seemed to be working except the files weren’t being written to disk.

Out of sheer desperation I came across the following options screen.

image

See the issue?

Turns out that at some point WordPress wrote the full *nix path to that option and didn’t error when it couldn’t find the path!

Did Your VMware Virtual Network Go Dead?

I just spent 20 minutes trying to figure out why the network in my VMware Workstation-hosted VM was dead. The VM was using bridged networking, but was unable to reach even the host. After trying everything under the sun I finally ended up in the virtual network editor. Turns out that VMware had bridged with none other than the ‘VirtualBox Host-Only Ethernet Adapter’. D’oh!Virtual Network Editor

Fortunately the fix was easy. Open up the Virtual Network Editor, either from Edit -> Virtual Network Editor. from within VMware Workstation, or directly from the Start menu. Under the Automatic Bridging tab, add the VirtualBox adapter to the list of excluded adapters.

For good measure I went in to VirtualBox to make sure that it didn’t encounter the same issue. VirtualBox seems smart enough to distinguish between the physical and virtual adapters on the system (VMware adds 2 virtual adapters), as only the physical adapters are in the list of interfaces to bridge to.

Holy Crap – Windows Virtual PC Supports Aero

Virtualization is a fantastic technology – especially for developers who want/need to work on different operating systems, need multiple different environments, or otherwise don’t want to muck up their machines. Given the current state of hardware today – a quad-core machine with 8GB or RAM can be built for as little as $500 – virtual machines are able to run at near-bare-metal speeds.

One downside to virtualization is that you can rule out just about anything 3D. Vendors of desktop virtualization software have been slowly trickling support for 3D into their products, but as far as I know these implementations are limited in their capabilities, and none of the vendors – not even the reigning champ VMware Workstation – supports Vista’s Aero desktop.

Enter Windows Virtual PC

After a long hiatus, we’ve finally been clued in to what the Virtual PC team has been up to. For Windows 7 Virtual PC has been resurrected as Windows Virtual PC. Unlike previous versions of Virtual PC (the last being 2007 SP1, last updated in May of 2008) this new incarnation has been integrated with the operating system and provides some very neat integration features.

Out of morbid curiosity I installed the RC of Windows 7 x86 in Virtual PC. Once the installation completed I was greeted with what is commonplace in virtual machines, no Aero.

No AeroAs always, the first thing I do with a fresh virtual machine is to install the integration components and reboot. After the reboot everything looked the same – no surprise. But low and behold if you select Tools >> Enable Integration Features you are greeted with glorious eye-candy!

Aero enabled!

So Close…So Very Close

Having discovered this incredibly under-reported capability of Virtual PC, my next thought was to see if Aero would be enabled when launching an application in the guest from the host’s start menu (i.e. Windows XP Mode).

No more AeroNope…doesn’t work. Not sure if this is a bug or on purpose at this point – since the integration components in the guest provide the Aero capability as well as the ability to publish applications to the host, it seems logical that the components would enable Aero in host-launched applications.

More To Come

There’s some really neat stuff in the new Windows Virtual PC. It’s quite a shift from previous versions, and still has some significant limitations compared to the competition, but the improvements are very, very welcome! I’ll be working on a more complete post about using Windows Virtual PC, but in the mean time if you are on Windows 7 RC, go download it!

SQL Data Services Will Be A Fully Relational Database In The Cloud

Over on the SDS team blog, they’ve just dropped a bombshell – v1 of SDS will essentially be a fully relational database in the cloud!

.given the feature set we are planning to support in SDS v1, a majority of database applications will “just work”, allowing developers to target on and off-premises deployments with essentially the same code base.

Why is this such a big deal?

This change to SDS removes what I consider to be the largest barrier to entry – data persistence. Assuming that you’ve got an existing application that uses a traditional database, it would take a significant effort to refactor it to use either the Azure table storage or SDS. That is also assuming that the limited query capabilities of one of the storage services met your needs. Once the announced changes are posted, it becomes much more feasible to run an existing application in the cloud.

The ambiguity between SDS and the Azure table storage has also been resolved. As those two systems exist today, it is difficult to explain the difference. The best explanation I’ve come up with is that while you can create ‘relationships’ using either service, SDS allows you to query against those relationships without having to fetch part of the relationship first. Now the difference is clear – SDS is a relational database, Azure table storage is highly scalable entity storage.

A word of caution.

While this does considerably lower the barrier to entry, it is critical to remember that simply hosting your application in the cloud does not mean it will scale! A poorly designed database will still perform poorly in the cloud as it will in your own data centers. It is the developers’ responsibility to make sure that it can handle the expected loads. SDS can now provide a highly available, highly accessible, redundant database, which is both extremely difficult and expensive to do on your own – it is not a magic bullet!

The Azure Services Platform is an amazing set of services, but my feelings are that the concepts and patterns it encourages are its most significant attribute because they promote scalable designs. It is critical to remember that at scale, things behave very, very different. I’ve personally experienced this on two projects, and in both cases the scale we were experiencing was never tested. Whether or not you deploy on Azure or in your own environment, these concepts and patterns are applicable, and can lead to more scalable designs.