J.D. Meier's Blog

Software Engineering, Project Management, and Effectiveness

VMs for Web and Worker Roles in Windows Azure

VMs for Web and Worker Roles in Windows Azure

  • Comments 9

This is my current mental model for Virtual Machines (VMs) for Web and Worker Roles in Windows Azure:

VMs for Web and Worker Roles in Windows Azure v2

On Windows Azure, you run your application in Web and Worker Roles.  Each instance of a Web or Worker Role runs in a VM.  You define how many instances of each Web or Worker role you want to run.  Windows Azure then spins up a VM for each instance.  You can choose from 4 flavors of VMs: one core, two core, four core, and eight core.

Here is a summary of the key components:

  • Web Role - includes Internet Information Services (IIS) and can accept HTTP and HTTPS Requests.  A Web Role talks to a Worker Role indirectly through a queue, or you can talk directly using WCF.
  • Worker Role – is not configured with IIS and is primarily for background processing, such as queuing, monitoring, or ticket-system scenarios.
  • Windows Azure Agent – each VM has an agent that lets your application talk to the Windows Azure Fabric using an API.

The load balancer spreads the incoming HTTP or HTTPS requests across your Web Role instances.

For a higher-level view, see my related post, Windows Azure Platform at a Glance.

  • JD - this series is coming along very well! Keep posting! Good stuff!

  • Thank you!

  • Love your stuff!  

    The question I have is with the Worker Roles and exposing a socket interface externally (bypassing the Web Role altogether).  Is this supported?  Can it be supported without using WCF?  Assuming it is supported, what would be the story for load balancing then?

  • @ RP

    Thank you.   I think the Worker Role can make outbound calls, but can't accept inbound calls on the Web.  I think the main scaling is adding VMs, but you should check out Manuvir Das's video interview - http://channel9.msdn.com/posts/Charles/Manuvir-Das-Introducing-Windows-Azure/.

  • Thanks JD.  When you hear about Worker Roles you hear the analogy of Windows Services.  With that analogy in mind, it is natural to assume that one could host a socket listener either using System.Network.Sockets or using WCF...  It looks like I will have to just open an account with Azure and dig in to find out.  I will let you know what I find if interested.

  • @ RP

    Yes, I would be interested in the answer.

    Thank you.

  • Can you please illustrate more on how the load balancing is done? what's the technology used? is it a piece of software (maybe IIS?) or hardware?

    Is there load balancing done to distribute load between worker role instances?

    Thanks,

    Mohammad Hajjat

  • @ Mohammad

    - the worker role is not load balanced

    - You balance the work simply through queuing (background processing) and allocating more worker roles as needed

    - if your worker role happens to make an outbound TCP or HTTP call, then that outbound call is routed through the load balancer

  • J.D.,

    Thank you. How about load balancing between web role instances? is that done thru hardware?

    Thanks

Page 1 of 1 (9 items)