How to configure our web app to handle sudden spike up and also down with autoscaling?

Maria21 21 Reputation points


We have a unique situation that presents some problems. We have an exam making website for schools. That means the website would be used like less than 1% capacity during the month except couple of days usually evening for a few hours with %100 percent capacity when a few thousand students take the exams.

When a school schedule an exam let say that should start between 9:00 PM- 9:02PM for 3000 students, suddenly usage will spike up. Usually students will come at last minute. So the website user count suddenly increase from a few users to a few thousand users in a few minutes. Our exam page is also very database demanding.

In addition to these technical problems, the cost is also very critical for us, since our currency is very weak against dollar. We can quickly go down with wrong configuration.

So, the requirements we have:

1.) The website normally would be used by a few users and can be able to increase its capacity to support a few thousand users in couple of minutes during the exams. The time is very critical here because the schools want the students to start the exams at the same time for preventing cheating. So when the students come, suddenly, the websites capacity (servers, db etc.) must have already been increased the support high demand. Is it possible to scale up capacity in couple of minutes or would it requires some kind of warm up to increase number of servers etc.

2.) This capacity increase should also be supported SQL Server database and if possible should decrease when exams finished.

3.) When the exams over, there will be very few users so that the capacity for the web and database should be lowered to their minimum to lower the cost, since the high capacity won't be needed.

Cloud is designed for scalability. However in our case we need very quick scale up and also scale down.

As I said cost is also very critical for us. How can this web app be configured or setup to auto scale up and down in Azure.

Thanks in advance,

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
1,857 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,531 questions
0 comments No comments
{count} votes

Accepted answer
  1. SnehaAgrawal-MSFT 17,486 Reputation points Microsoft Employee

    Thanks for reaching here! As suggested by Sam above you may consider setting scale based on a schedule.
    Autoscale settings help ensure that you have the right amount of resources running to handle the fluctuating load of your application.
    You can configure Autoscale settings to be triggered based on metrics that indicate load or performance, or triggered at a scheduled date and time.

    You may refer below article which describes what Microsoft Azure autoscale is, its benefits, and how to get started using it.

    Please let us know if you have further query or issue remains, happy to help you.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Sam Cogan 9,967 Reputation points MVP

    Your scenario is not really unique, it's a fairly standard scaling scenario. Autoscaling will always have some time delay, which will be a combination of how long it takes you to hit your scale metric, and then how long it takes for the resources to scale up. For Azure Web apps you are limited to scaling based on CPU and Memory use, so you will need your load to increase before it triggers scaling, which sounds like it may be an issue for your scenario given you go from 0-3000 very quickly. One scenario could be to look at time based scaling, so you scale up based on specific date and times, if you know when your exams are running.

    If you can run your applicaiton in a container, you could look at Azure container apps, which allows you to scale on a much larger amount of metrics, and also allows you to scale to 0.

    0 comments No comments