Azure / Azure/Azure-Spring-Apps

Autoscale actions cause application downtime

Open
#51 17 comments 0 reactions 2 assignees Claimed by @Sneezry View on GitHub
Dominant language
No language data
Stars
9
Forks
11
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
After configuring autoscaling for a Spring App, when a scale in action occurs the application becomes unavailable because all running instances are terminated and new instance(s) meeting the effective scale in configuration are created. Because all existing instances are terminated, the application is no longer running and is not available to users for a short period of time while the first instance is starting.

A scale out action also results in all existing instances of the application being terminated and then new instance(s) meeting the effective scale in configuration are created. A scale out doesn't result in application downtime because a new instance is started before existing instance(s) are terminated, however for applications that store user httpsession state in memory, the end user of those stateful applications will need to log into the application again because their httpsession state is lost due to the termination of all existing application instances.

**To Reproduce**
Steps to reproduce the behavior:
Create auto scaling for a Spring App deployment using commands similar to these:

```
az monitor autoscale create --resource /subscriptions/xxxx/resourcegroups/yyyyy/providers/Microsoft.AppPlatform/Spring/zzzzz/apps/instashare-web/deployments/v1-3-0-105 --name instashare-web-autoscale-v1-3-0-105 --min-count 1 --max-count 2 --count 1

az monitor autoscale profile create -g rg-lzcorpspring-prod-cus-01 --autoscale-name instashare-web-autoscale-v1-3-0-105 -n instashare-web-autoscale-business-hours --count 2 --min-count 2 --max-count 2 --end 20:00 --recurrence week mon tue wed thu fri sat --start 8:00 --timezone "Eastern Standard Time"
```

When the start or end time of the instashare-web-autoscale-business-hours profile is met notice the behavior of the application instances regarding terminating existing ones and starting new ones.

**Expected behavior**
When a scale in action occurs, at least one of the existing running application instances should be kept running and not terminated to avoid application downtime. Desired behavior is that existing instances should be stopped to meet the auto scale settings and not terminate all existing instances and then only startup new instances meeting auto scale settings.

When a scale out action occurs, all existing application instances running should be left alone and new instance(s) should be started to meet the auto scale settings

**Can we contact you for additional details?** Y/N
Y

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.