Scale-down should support graceful selection of idle application instances instead of terminating instances with in-flight work

Ouverte
#1,663 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
35/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
go
Domaine
backend, cloud

Piste de recherche

Start by reading the App Autoscaler scale-down flow and how Cloud Foundry selects application instances for termination; the issue does not name specific files or tests. Compare the proposed instance-level metric, drain protocol, and preferred-instance mechanisms, then identify which layer could support the capability. Done means agreeing on a design that can select an idle instance while preserving in-flight work.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Problem ( Similar to GitHub issue #570)

We use the Cloud Foundry App Autoscaler with multiple application
instances that process asynchronous messages.

I feel this is detrimental bug to use SCALE UP or DOWN and every PRODUCT needs to come up with custom feature or have fixed instances. This if done by CF will save lot of time and effort..

CF SCALE can provide a option to get instance that should be scaled down then i will raise a ticket to autoscaler or team that identifies it to fix this issue as well..

Example:

Instance 0: BUSY - processing message
Instance 1: BUSY - processing message
Instance 2: BUSY - processing message
Instance 3: IDLE

Current instance count: 4
Autoscaler determines that the application should scale down to 3.

Expected behavior / requested capability

We would like the scale-down mechanism to preferentially terminate
an IDLE instance, rather than an instance currently processing
in-flight work.

The application can expose a custom metric indicating whether an
instance is BUSY/IDLE.

For example:

instance 0 -> processing=1
instance 1 -> processing=1
instance 2 -> processing=1
instance 3 -> processing=0

Ideally, scale-down could use instance-level metrics or an
application-provided drain/termination signal to select instance 3.

Current concern

Scaling metrics such as CPU, memory utilization, or custom metrics can
determine whether the application should scale down, but they do not
appear to influence which instance is selected for termination.

If a BUSY instance is selected, it receives SIGTERM. If its processing
cannot complete within the graceful shutdown interval, it may
eventually receive SIGKILL.

For long-running asynchronous/message-processing workloads this can
interrupt in-flight work even when another instance is completely idle.

Use case

We have applications where processing a message may take substantially
longer than the graceful shutdown period.

CPU and memory utilization are also not reliable indicators that an
instance is idle because a BUSY worker might be waiting on external
I/O while still owning/processing a message.

Feature request

Could Cloud Foundry support one of the following?

  1. Instance-aware scale-down based on an instance-level custom metric
    (e.g. processing=0), or

  2. A drain protocol where an instance is asked whether it is safe
    to terminate before CF removes it, or

  3. A mechanism allowing an application/autoscaler to identify a
    preferred instance for termination.

The objective is:

4 instances:
BUSY, BUSY, BUSY, IDLE

scale down 4 -> 3

Desired:
BUSY, BUSY, BUSY

rather than potentially terminating one of the BUSY instances.

Langage dominant
Go
Étoiles
71
Forks
60
Merge moyen
6 h 33 min
PR mergées (30 j)
47

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de cloudfoundry/app-autoscaler

Toutes les issues de cloudfoundry/app-autoscaler

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.