Scale Apps in Azure App Service Flashcards

1
Q

What is autoscaling?

A
  • can be triggered according to a schedule or by assessing whether the system is running short on resources
  • adjust available resources based on current demand with scaling IN and OUT not UP and DOWN
  • efficient autoscaling ensures sufficient resources are available to handle large volumes of requests at peak times, while managing costs when demand drops
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How does autoscaling monitor app services?

A
  • Detects situations where other resources are required to handle an increasing workload and ensures those resources are available before the system becomes overloaded
  • Adds or removes web servers and balances load between them
  • Doesnt have any effect on power of web servers, just the number of servers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are auto scaling rules?

A
  • Specify the threshold for a metric and triggers an auto scale event when this threshold is crossed
  • Need to define rules carefully, we don’t want to scale up to handle a DDoS attack
  • Instead we would implement detecting and filtering of requests that occur during such an attack before they reach the service
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the + of autoscaling?

A
  • elasticity; enables you to scale out during business hours and in during offline hours
  • improved availability and fault tolerance; ensures client requests to a service wont be denied because of instance timeout or crashing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the - of autoscaling?

A
  • Does not increasing power of resources so any resource intensive process might need to be manually scaled up otherwise it could cause crashing
  • long term growth; a web page that starts off with a few users but then grows will cause issues as autoscaling has an overhead associated with monitoring resources and determining whether to trigger a scaling event
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do App Service Plans handle auto scaling?

A
  • When the web app scales out azure starts new instances of the hardware defined by the app service plan to the app
  • to prevent runaway autoscaling an app service plan has an instance limit
  • more expensive plans have a higher limit
  • not all pricing tiers support auto scaling
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the two ways to scale?

A
  • Based on metric; number of HTTP requests awaiting processing for example
  • Based on schedule; certain days of the week or times
  • you can combine them so an instance scales out if it goes above a metric on certain days of the week
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the metrics you can monitor for web apps?

A
  • CPU %
  • Memory %
  • Disk queue length
  • Http queue length
  • data in; bytes recieved across all instances
  • data out; bytes sent across all instances
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the first step of autoscaling?

A
  • An auto-scale rule aggregates the values retrieved for a metric for all instances across a period of time known as the time grain
  • each metric has its own time grain
  • this aggregated value is the time aggregation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the second step of autoscaling?

A
  • Performs further aggregation of the value calculated by the first step over a longer, user-specified period known as the duration
  • min value for this is 5 mins
  • for example; if its set to 10 mins and time grain of metrics is 1 min then it will aggregate the 10 values collected
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the third step of autoscaling?

A
  • calculated value for the duration can be different from the time grain
  • e.g. if the time aggregation is Average and the stats gathered is CPU % across 1 min time grain, each min the avg CPU % use across all instances for that min is calculated
  • if the time grain is set to Max, and the duration of the rule is set to 10 mins, the max of the 10 avg values for the CPU % usage is used to determine whether the rule threshold has been crossed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Describe an autoscale action?

A
  • can be sale out or scale in
  • uses operators such as >,< or =
  • has a cooldown period specified in mins
  • during the cooldown the rule wont be triggered, allowing system to stabilise
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why should autoscale rules be defined in pairs?

A
  • one is used for how the system scale up when it exceeds the threshold and one for vise versa
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Can an autoscale condition have more than one autoscale rule?

A
  • yes
  • they dont have to be related
  • one could be for HTTP queue length and the other for CPU %
  • on scale out autoscale runs if any rule is met, on scale in all rules must be met
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Where can auto scaling settings be found?

A
  • App Service Plan -> Scale Out pane
  • by default only implements manual scaling
  • has a run history chart to show how the number of instances vary over time and which conditions caused each change
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the key concepts of autoscaling?

A
  • scales horizontally; has a min, max and default instance value
  • always reads the associated metric to scale by checking if it has crossed the configured threshold
  • all thresholds are calculated at instance level
  • all autoscale failures are logged to the activity log which can be configured to send SMS or emails whenever there is activity
17
Q

What are some autoscaling best practicies

A
  • ensure min and max values are different and have a margin between them
  • choose appropriate stats for your diagnostic metric
  • choose the thresholds carefully for all metric types to avoid flapping
  • always select a safe default instance count
  • configure autoscale notifications