Thursday, May 16, 2013

Choices of deployment on Windows Azure

Azure provides many choices of deployment, for both web/application servers and database servers. You will never fully appreciate how powerful these choices are, unless you actually played with it. 

Last week, I played with it as part of a load test project, and I was amazed by its capability even though I presented these features individually many times before.

My test setting is a very typical LOB web application. ASP.NET web tier, SQL Database, plus IE or Visual Studio load test client running on laptop. I tried many different deployment options, and compared the performance differences. It's very easy to switch from one deployment to another. Just a few clicks on the Azure management portal or simply republish the project from Visual Studio. Here are my learning.

Overall design:

Deployment Options:
Website: Azure Website free tier, Azure Website reserved instances, Web Role instances, multiple number of instances
SQL: Azure SQL Database, SQL Server in Azure VM, multiple sizes of VMs
Load test client: laptop, Azure IaaS VM
Network: Virtual Network, or not

Performance findings:
  • Azure website free tier, performance quota will soon be blown, and request will be rejected. 
  • Azure website reserved instance, and Web role instance. Performance is comparable between these two options. Both can scale pretty well, and performance is stable.
  • SQL Server in VM. Tried different file placement. There is some perf improvement by moving log/temp files to other disks, however the improvement is not significant. Need further investigation.
  • SQL Server in VM. Switching to bigger VM significantly improves performance.
  • SQL Azure vs. SQL Server. This is the most interesting part. SQL Azure 1 GB Database achieved comparable performance as SQL Server in Middle sized VM. The price of SQL Azure is only 1/10 of that of SQL Server in this configuration. The result should be related to my testing workload (a mixture of read/update/insert against NopCommerce web), and should not be generalized without further investigation.

Monday, March 18, 2013

Bowlus for AWS

To learn the upcoming Azure IaaS Virtual Machine, I decided to migrate Cloud Samurai project (code named Bowlus) to IaaS infrastructure. Since Azure IaaS is not GA yet, I did this first on Amazon AWS. This  also gave me an opportunity to learn and compare the IaaS offering from both Azure and Amazon.

After the initial redesign for IaaS, I found the benefit of IaaS is rather obvious:

  • Use the more mature IIS Web Deploy cmdLine tool to provision web site, instead of update IIS configure file directly.
    • Updating IIS configure file is a little bit dangerous, and it will cause troubles when concurrent access is not managed well.
    • Web Deploy is mature tool which is also used in Visual Studio to deploy web site to Azure. 
    • Using Web Deploy generates deployment logs, which helps diagnosis and auditing.
    • De-provisioning web site using Web Deploy is also cleaner and safer.
    • This is only possible under IaaS, since you have to pre-install Web Deploy tool and other dependent services in the VM.
  • Reduce two layers: routing + hosting, into one layer. The design is thus more simple and robust.
    • This change might also work in PaaS. Need further investigation.
    • IaaS gives us more flexibility to manage end points on each VM, and thus makes this design change more natural.
This is the live test link:


This is the new design for AWS:

Wednesday, November 28, 2012

Understand Persistent VM Disk (2)

Since all persistent PVM disks are eventually stored in blob storage, there must be a way to manage these disks and the .vhd files in the blob storage. The tools and portal to manage these are simple and straight forward, but understanding below key concepts would be very helpful for you to use those tools.

There are three stages of a .vhd file or a PVM disk:
  1. raw .vhd file in blob storage (use any blob explore tool to manage this)
  2. .vhd files recognized by PVM as disks (use Azure portal to create/delete disk)
  3. PVM disk attached to a PVM instance (use Azure portal to attach/detach disk)

O/S disk vs. Data disk: this is decided when you recognize a raw blob file as a disk. O/S disk can be used to create a VM instance.

Image vs. Disk: Image is "sysprepared" O/S disk. You can use either Image or O/S Disk to create a VM instance. If you use O/S Disk, all the old user name, machine name etc. persist, while everything is as from scratch if you use Image.

Understand Persistant VM disks (1)

Persistent VM (PVM) is Azure's IaaS offering comparable to Amazon's EC2. Unlike EC2 which uses local disks for the majority of the time, PVM uses Azure blob storage to store disks. This design has multiple implications.

On the good side, your data in the disks are more reliable, as every Azure blob automatically has 3 local copies which are always synchronized and another 3 copies in a different data center 100+ miles away which is delay synchronized. On the bad side, the disk I/O performance might be impacted. For this reason, PVM do use both Azure blob backed disks and local only disks to optimize the disk I/O, so it's important to understand where each disk lives. Below is the explanation:

C: disk is the OS disk. Persisted in blob storage.


D: disk is local disk. Not persisted, but very fast.

F: disk is additional user data disk. Persisted in blob.

Friday, June 15, 2012

Azure Web Site

When we were developing the CloudSamurai multi-tenant framework, we were aware that there is an official Microsoft project doing the same thing as CloudSamurai using the similar ARR approach. Of course, the MS official project must be more mature and more complete in features. Although, we didn't know when and how this official MS offering would be available.


In the latest Azure June 2012 release, the 'Azure Web Site' is unveiled. This is the MS-self hosted version of high-density share-IIS multi-tenant web site solution. It is expected that the customer-hosted version be released in the next big release. Here is the official description of 'Azure Web Site':


"Quickly and easily deploy sites to a highly scalable cloud environment with the frameworks and open source apps of your choice using Windows Azure Web Sites. Get started for free and scale as you go on a cloud platform that enables automatic scale-out options across shared and reserved instances for greater isolation and performance."


You should also check ScottG's blog for more information:
http://weblogs.asp.net/scottgu/archive/2012/06/07/meet-the-new-windows-azure.aspx

Saturday, April 14, 2012

Messaging VS. Notifying

Messaging is the basis of all SOA design, however most people don't know the essense of 'Message' in SOA is actrually 'to convey as little information as possible'. If you can convey less infomation but still get the task done, the design would be better than if you convey more information. Because by doing so, you reduced the inter-system dependency.


The essense of 'Message in SOA' is thus not WCF, not SOAP, not Web Service. It's about how to share information between different entities, while try to keep the dependency between entity as little as possible. Some people use xml as message, while transmit a very complex and big xml. It's not a good practice. Sharing little knowledge. The less the better.


In this sense, Notifying would be a better design than Messaging, because Notify only convey a simple code while Message can be very complex. We learned a lot from project Cloud Samurai(http://cloudsamurai.codeplex.com/), and thus decided to use Notify rather than Message in the project.


Emerging Order

As we found in several Azure projects, designing complex inter-system interaction is very challenging. Most Azure projects would involve multiple VMs, and multiple components or processes inside each VM, so they are typical inter-system design problems.


SOA (Service Oriented Architecture), although sounds old, is probobaly the most effective way to handle this challenges. However, we need to take a special view through the SOA len. We should emphasis more on Independence. If we can design autonomous and independent components, who can respond to the environment and messages in an intellectural and responsive way, the Order of the inter-system will Emerge as a result.  The complex behavior of the inter-system is hard to be designed, rather it will emerge from the group of independent components.


We learned a lot about the principle of Emerging Order from this project.
http://cloudsamurai.codeplex.com/