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. 

Comments

  1. Cloud hosting literally means your website is served on a web server cluster with many, many web servers handling all of your visitors. Our hosting platform grows and expands automatically as needed… instantly.

    ReplyDelete
  2. Cloud Computing has various flavors, each purposely aimed at aligning with the varying business modules prevalent today. Managed Cloud Hosting is ideal for businesses that give precedence to factors like impregnable security and high availability instead of costs being incurred.

    ReplyDelete

Post a Comment

Popular posts from this blog

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\TempDelete all EventViewer logs Save to another Disk if you want to keep themRemove any unused programs, e.g. FirefoxRemove anything in C:\inetpub\logsRemove any file/folders C:\Windows\System32\LogFilesRemove any file/folders from C:\Users\%UserName%\DownloadsRemove any file/folders able to be removed from C:\Users\%UserName%\DesktopRemove any file/folders able to be removed from C:\Users\%UserName%\My DocumentsStop Windows Update service and remove all files/folders from C:\Windows\SoftwareDistributionDeleting an Event Logs Run COMPCLN.exe Move the Virtual Memory file to another disk However this wasn’t enough & I found the most space was cleared by using the Disk Cleanup to…

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 graduated rate, b…

Implementing Custom Castle Windsor Facilities

If you’ve been following my posts you would know that I love Castle Windsor. One of the many useful features I have found is the Facility and I’m going to try and give a good example how you can make use of this. In a recent post I showed how you can add Cross-Cutting concerns to your application by using Interceptors.Now when configuring the Container you can explicitly configure each Interceptor per Service but when you have lot’s of components it can get pretty hard to maintain after a while and can also introduce subtle issues if someone forgets to configure it correctly.Below is how you would configure your Container without using a Facility. On the last line we are specifying the Interceptor explicitly. public void Configure() { container = new WindsorContainer(); container.Register( Component.For<CacheInterceptor>(), Component.For<ICacheProvider>() .ImplementedBy<WebCache…