Search code examples
azureazure-worker-rolesazure-vm-role

windows azure VM load balancing


Trying to migrate to windows Azure. We have a whole bunch of customizations and sharding code built in and so we thought it would be a better idea to go with the VM roles - My assumption is that we could manage it as a regular server and deploy our app onto it. The database is already on SQL Azure.

Question - In our current non-Azure setup we have two web server boxes with a load balancer. I remember reading something about web roles and how Azure load balances between instances (web or worker roles). Does Azure support load balancing between two VM roles?

More importantly, is the performance going to be better if we go with a worker role (since the code seems to be more tightly integrated with Azure). Would be great if anyone could point me in the right direction. Many thanks.


Solution

  • The load balancer distributes traffic across instances of your role, whether Web, Worker, or VM. An end user (or system) simply contacts your service via protocol://ip:port. If, say, you host port 8000 on a VM Role, and have 4 instances of that role, you'll see traffic distributed across all 4 instances (no different that with a Web role).

    Performance shouldn't really be any different between Worker Role and VM Role. The difference lies in the maintenance of the Guest OS itself. If you can utilize a Worker Role instead of VM Role, you're making your life easier when it comes to updates (and no need to push a big multi-GB image to the cloud). There are really 3 core reasons why you'd need to use a VM Role:

    • No way to automate installation of needed apps (e.g. any MSI's you need to run, registry updates, etc.)
    • You can automate install, but it takes too long (e.g. greater than 5-10 minutes)
    • You can automate install, and have it complete in timely fashion, but it's simply not a reliable install (e.g. some component occasionally fails during install, resulting in role recylce and repeated install attempts)