Skip to main content

Scaling Azure Web Apps

What is Scaling?

Scaling in Web Applications world refers to adaptability to changed load and traffic. Availability and Performance are the most important aspects of any Web Application. Hence, any Web App should be able to adapt to the changed amount of workload and traffic that it gets.
When we deploy our web apps to azure, it is called an instance. It is allocated certain amount of hardware resources & servers depending upon your App Service Plan.

There are basically two kinds of scaling that is performed on a web application:

  1. SCALE OUT (Horizontal)

    • Scale Out refers to increasing the number of instances for your web application. To scale out a web app, you increase the number of virtual machine instances on which your web app is running.

  1. SCALE UP (Vertical)

    • Scale Up refers to increasing the resource capacity, such as RAM and CPU cores, of the virtual machine on which your web app is running.

Why Scaling?

  • Pages load slowly,
  • Network connections start timing out, and
  • Your servers are starting to creak under heavy load. 

When to Scale Up and When to Scale Out?

You typically choose to SCALE UP when any single request demands more memory and processing power to complete.
You typically SCALE OUT when any single request requires less memory and processing power to complete, but the number of incoming requests become too much to be handled by a single server.

How to configure Scaling?

To Scale Up:

  • Go to App Services in the Azure Portal
  • Select App Service
  • Go to Settings
  • Select Scale Up (App Service Plan)
  • Select from the available Plans based on Number of Cores, RAM, Storage, Number of Instances and Backup Frequency.

To Scale Out:

  • Go to App Services in the Azure Portal
  • Select App Service
  • Go to Settings
  • Select Scale Out (App Service Plan)
  • You can Scale Out the app service based on Instance Count, CPU Percentage, Schedule & Performance Rules




Benefits of Scaling?

  • Address bottlenecks in your web app faster
  • No Code required
  • Web app doesn’t need to be re-deployed.
  • Web app can handle more load and therefore service more user requests.

Comments

Post a Comment

Popular posts from this blog

Handling Concurrency in Azure Functions (HTTP Triggered)

Concurrency & Isolation Concurrency is one of the most common requirements when we don't want the resource to be accessed by multiple requests at the same time. Lets say we have a Database that holds products stock information, then it is very important that any read/write operation that happens on the Database must hold the property of Isolation . The isolation property ensures that the concurrent execution of transactions results in a system state that would be obtained if transactions were executed sequentially, i.e., one after the other. Providing isolation is the main goal of concurrency control. Depending on the concurrency control method (i.e., if it uses strict – as opposed to relaxed – serializability), the effects of an incomplete transaction might not even be visible to another transaction. Options Available in Azure Functions Recently while working on Azure Functions, I discovered a really simple way of handling Concurrency via code. There are ways to con...

Creating Azure Function from Visual Studio 2017 triggered from Azure Service Bus Topic

Recently, I was building an Azure Function from Visual Studio and encountered an issue with the auto generated Function.cs class file. My requirement was to create an Azure Function that would get triggered as soon as we receive a message on an Azure Service Bus Topic. For this I tried to use the Project template available in Visual Studio 2017. Unfortunately, when I tried to provide all the required values, and run the function, I got following error: First you get a warning which says: Warning: Cannot find value named 'Endpoint=sb:......' in local.settings.json that matches 'connection' property set on 'serviceBusTrigger' in '\Source\repos\FunctionApp1\MyFunction\bin\Debug\net461\Function1\function.json'. You can run 'func azure functionapp fetch-app-settings <functionAppName>' or specify a connection string in local.settings.json. This warning was followed by an error: [2/12/2018 9:48:05 AM] A ScriptHost error has occurre...

Retrieve 5000+ Records in Dynamics 365 CE using CRM OData, Fetch XML and C#

If you want to retrieve 5000+ records in Dynamics 365 CE, you need to make use of Paging concept of CRM. By default 5000 records are retrieved in a single OData call in CRM. To get more, you need to make subsequent calls to OData Endpoint by passing a paging cookie in the request. I will be using a simple C# Console Application to retrieve 5000+ records from Dynamics 365 CE, by making use of OData API Endpoint provided by CRM and passing Fetch XML in OData Call . Concept: CRM OData Endpoints allows us to use Fetch XML to retrieve data from Microsoft Dynamics 365 CE.  If your resultset has more than 5000 records, you will be returned with first 5000 records ONLY in one OData call. To know if the resultset has more than 5000 records, we make use of the response from OData call. The response is added with a cookie value contained in a key - "@Microsoft.Dynamics.CRM.fetchxmlpagingcookie" If you wish to fetch the next set of resultset data, you will have to pass this c...