Skip to main content

When to use Azure Virtual Machine Scale Sets?

So it all started with client's requirement to build a Minimum Viable Product (MVP). The backend of the product was written in python and involved processing of images using Computer Vision. We decided to host the backend in Azure.
There were lots of advantages of having the backend hosted in cloud instead of having an on-premise setup. The thing that attracted us the most was infrastructure scaling and availability of the system. We now dont have to bother about infrastructure, power consumption, system availability, system failures, etc.

We were in need of GPU machines to run the code in backend. We though of using N-Series Azure virtual machines for this purpose. We wanted to scale the machines horizontally to handle multiple requests. We booted up few more machines to handle the load. This is where Azure Load balancer came into picture. Since there were multiple instances of virtual machines, we needed someone to decide for us, which machine the request should go to. We connected all the machines to Azure load balancer and offloaded this decision making to it. Load balancer gave us the common endpoint to reach out to any of the server machines.

Soon we realised that this this, will not make the system fully scalable as we have to decide the number of instances that are connected to the load balancer. After some research, we came across Azure Virtual Machine Scale Sets. This was meant to solve the exact same problem.

Brief about Azure Virtual Machines Scale Sets (VMSS):
VMSS can be used to create a set of machines from the same image of OS. this image can be either public OS image from azure images store or a custom private image created by user with all the setup and packages needed.

VMSS has the ability to create a new VM instance from same image when certain condition is evaluated to true. These conditions has to be specified by the user. Example: When CPU reaches 75%, when RAM is 80%, when network inbound is x, etc.

Since VMSS is a set of machines grouped under same subnet of VNet and doing the same task, we need to add a load balancer to balance the network inbound to each of these machines. Azure provides load balancer as a service which can be used with VMSS. Load balancer has a public IP address associated with it, which can be used to make requests to the VMSS machines. Load balancer decides depending upon the load, which machine to send the request to.

Depending on the type of application, there can be multiple servers in the backend hosted on different machines/Azure services like webapp services, function apps, etc. In such cases we will end up having different base URLs to access different servers. This can be inconvenient for client applications. Also rate limiting of requests, monitoring the file upload sizes, adding custom authentication headers, etc becomes a bit of challenge in such cases.
Azure provides Application gateway as a service to solve these problems. Read more about application gateway and its application in this article.

Comments

Popular posts from this blog

Product review of cloudsploit

Hello People! This article is to share my understanding about cloudsploit and the service they provide to the people. What they do? CloudSploit is a service which analysis your AWS/Azure account for security holes/risks. With people moving to serverless technologies, Azure and AWS are gaining popularity these days at higher rate. Also alot of developers/dev-ops engineers tend to overlook some of the security considerations while setting up services in cloud. CloudSploit is here to address such problems for you! How do they do it? CloudSploit asks you for a access key with read only permissions to your cloud resources. They have a set of plugins, which run using this access key. Each plugin is a javascript function which uses some node cloud SDKs to analyse the services in cloud. Result of what they do When you run CloudSploit, as a final output you get to see different plugins and their test results. The plugins also have recommended actions section which tell...

Building Installer for mac using packages (Implementation level details)

So now that you have a code ready, next question is how you are going to ship it as a product to end users. The easiest and user friendly solution, is to build the Installer for your product! Building an installer has many advantages, like: User don't have to be worried about the installation steps (the user has to just follow laymen's instructions to get ready to use the product). It eliminates human errors. Makes the product easy to install and use. So now that we have idea of WHY  we need Installers, let see what  packages  offer us to build installers for mac.  Packages is a tool developed for mac. Packages can be either flat or bundle. As per my observations, flat packages cannot be inspected to view the contents of the package. But there are ways to extract the contents for viewing purpose using  pkgutil  utility. In case of Bundle packages, user can view the contents of the bundle directly. Its like a directory. Packages...