Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jenkins2-ha-agents does not scale down if there is at least one job running #677

Open
Ten0 opened this issue Mar 21, 2023 · 1 comment
Open

Comments

@Ten0
Copy link

Ten0 commented Mar 21, 2023

On this template:

BuildActiveQueueEmptyAlarm:
Type: 'AWS::CloudWatch::Alarm'
Properties:
EvaluationPeriods: 1
Statistic: Maximum # special rule because we scale on build queue length
Threshold: 0
AlarmDescription: 'Alarm if Build Queue is empty and no jobs are active.'

The alarm only triggers if there are absolutely no jobs left running.
This means that if e.g. during the day you need on average 20 agents, max 50, but never less than 1, you'll still always pay for 50 agents because as you always have one job running the alarm never triggers.

It looks like this could be fixed by:

  • Making this alarm trigger if there are agents that don't do anything
  • Using scale-in protection (on ASG) to prevent instances that currently have jobs running from being picked for termination
@michaelwittig
Copy link
Contributor

I agree. The tricky part seems to set scale in protection in a reliable fashion as quickly as possible after a job runs on an agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants