Skip to main content

Cloud Hosting - Amazon EC2

style="" >So recently I got the chance to deploy my first application to Amazon EC2. 
I've got to say after a little bit of trial and error I think the service is pretty amazing and is definetly the future of web hosting and you sure can't beat the price US $0.125 / Hour which is essentially US $90 / month. Bandwidth between S3 and your Ec2 instance costs nothing so is very attractive for Media Transcoding and other such tasks.
The requirements were as follows:
IIS 6.0
Ideally I would want to host the Application on a Windows Server 2008 instance so that I could leverage the features of IIS 7.0 and also have a dedicated SQL Server 2008 instance, but unfortunately Amazon does not support this yet and it's unclear when this will happen so I had to use a makeshift approach.
To manage your instances you can and should use the Firefox Plugin ElasticFox. It makes it very easy and I didn't have to read the documentation once.
The AMI (Amazon Machine Image) that I used as a base was ami-b13cd8d8
which is a 32-Bit Windows Server 2003 with:
  • IIS
  • SQL Server 2005 Express
  • ASP.NET 
The first thing I did was uninstall SQL Server 2005 Express and then downloaded all the bits and pieces I needed. The download speeds were highly impressive, SQL Server 2008 Express which is about 500MB downloaded in less than 10 minutes and it's cheap too.
Unfortunately I didn't know enough about Data Persistance and the lifetime of Instances and so I saved all the downloads I need on the D:\ that is available on the Instance.
This turned out to be a mistake as when it comes to Bundle your configured instance into an AMI anything on the D:\ is not persisted.
So you have two options, either store any files on the C:\ or use an Elastic Block Store.
Without going into too much detail an EBS is a Logical Drive that you can attach to an instance and in my case is where I chose to store all Application files and Data.
Unfortunately the same EBS Volume cannot be attached to multiple instances, but there is the ability to create a snapshot of the EBS then create a new Volume based on the Snapshot. 
After I had configured my instance sans Application specific files it was time to bundle it into an AMI, this requires an Amazon S3 to store the AMI in.
Leave a comment if you want me to make the AMI public as it will save you a lot of time.
Now it was time to install the Application onto my newly created AMI.
The application itself is an ASP.NET MVC Web Application numerous IIS Hosted WCF Web Services.
As I mentioned I installed all the application specific files on my EBS Volume and set the SQL .MDF and .LDF files to be stored on the volume as well then set up IIS accordingly.
Installing the MVC app on IIS 6.0 requires a little bit of working to make the Routing work, see
for more info. I'm hoping Amazon will introduce Windows Server 2008 soon.
There are a few more things I need to resolve which include:
  • Distributed Cache
  • Multiple Instances
  • Dynamic DNS
  • Load Balancing
All in all I am very impressed with this service and whilst at the moment I am only researching this, I think it can't be ignored.
Next up I'm going to go through the same process with GoGrid.
Windows Azure looks very promising, however without Full SQL Server support it's not particularly useful at this stage as SQL Server Data Services is too immature for a Production system and the cost of changing from an ADO.NET Data Access layer to SSDS is too high at this stage. Also there has been no indication on Pricing or Service Level Agreements so we'll just have to wait and see.
Once there is an SSDS Adapter for Entity Framework then and only then could I consider changing my Data Access Layer. 

Popular posts from this blog

ASP.NET MVC Release Candidate - Upgrade issues - Spec#

First of all, great news that the ASP.NET MVC Release Candidate has finally been released.  Full credit to the team for the hard work on this.  You can get the download here  However this is the first time I have had upgrade issues.  Phil Haack has noted some of the issues here   If like me you have lot's of CTP's and Add-Ins then you might experience some pain in Uninstalling MVC Beta on Vista SP1  This is the list of Add-Ins / CTP's I had to uninstall to get it to work  Spec# PEX Resharper 4.1  Sourcelinks ANTS Profiler 4   Can't say I'm too impressed as it wasted over an hour of my time.  As it turned out Spec# turned out to be the offending culprit, it's forgiveable to have issues with a third party product but a Microsoft one? Guess no-one on the ASP.NET team has Spec# installed. 

Freeing Disk Space on C:\ Windows Server 2008

  I just spent the last little while trying to clear space on our servers in order to install .NET 4.5 . Decided to post so my future self can find the information when I next have to do this. I performed all the usual tasks: Deleting any files/folders from C:\windows\temp and C:\Users\%UserName%\AppData\Local\Temp Delete all EventViewer logs Save to another Disk if you want to keep them Remove any unused programs, e.g. Firefox Remove anything in C:\inetpub\logs Remove any file/folders C:\Windows\System32\LogFiles Remove any file/folders from C:\Users\%UserName%\Downloads Remove any file/folders able to be removed from C:\Users\%UserName%\Desktop Remove any file/folders able to be removed from C:\Users\%UserName%\My Documents Stop Windows Update service and remove all files/folders from C:\Windows\SoftwareDistribution Deleting an Event Logs Run COMPCLN.exe Move the Virtual Memory file to another disk However this wasn’t enough & I found the most space...

CPF Contribution Rates for new Singapore Permanent Residents (SPR’s)

Recently my wife and I applied and got approved for Singapore Permanent Residency. After completing the formalities the most significant immediate change is the contribution to CPF which is Singapore’s mandatory social security savings scheme requiring contributions from employers and employees. CPF contributions start from the date you obtain SPR status, which is the date of the entry permit.   Being a relentless budgeter I needed to know exactly how much I and my employer would have to contribute so that I could adjust my budget accordingly as the employee contributions get deducted from the monthly salary. After doing some research I discovered that there is a “graduated” approach to CPF contributions for new SPR’s where the contributions gradually increase in the first and second year and then upon reaching the third year are at the full amount. Note: There is an option for employers to contribute the full amount for year 1 and year 2 and the employee can use the gra...