Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-75437

Jenkins EC2 Plugin overprovisiones nodes when using AMI filters

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • ec2-plugin
    • None
    • Jenkins version: 2.462.3 LTS
      Java: Java 17
      EC2-Plugin: 1790.ve2a_e5e0b_d90d

      Jenkins runs in AWS EKS cluster. Deployed using helm-chart
      Jenkins EC2 agents: Ubuntu 20-22.04, java 17.

      Recently we decided to ease upgrading images for agents and switch from specific AMIs to AMI filters. However QA engineers on our project run jobs by schedule and runs 300 different jobs to test our environment. Previously we had 10 nodes with 2 executors provisioned because instance capacity did not allow Jenkins to provision more. When we switched to AMI filters we've seen that 20-30 nodes are provisioned during that time.

      I created a test agent with Instance capm = 1, executors also 1 and created a fake load on them running ~10 jobs with sleep command for a minute. When AMI filters are in place it starts to spin up a lot of nodes and it works the following way:

      Instance cap is 1 for this example.

      1. Number of instances = 0 < 1 → spin up more instances. It spins up a lot of instances as you can see on screenhot.
      1. Number of instances = 1 == 1 → Do nothing
      1. Number of instances = 2 > 1 → Do nothing.

      So if previously instance capacity was reached. 1 in our example. Jenkins will not provision any more instances, but when instance capacity is not fulfilled Jenkins tries to provision much more instances trying to cover the load.

      We would like to see the same behaviour when we are using simple AMI ID field but with AMI filters

      Please let me know if any other information would be helpful

            thoulen FABRIZIO MANFREDI
            viacheslav_kozachok Viacheslav
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: