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

EC2 Instance cap is not respected

    Details

    • Similar Issues:
    • Released As:
      1.45

      Description

      In Manage Jenkins -> Configure System -> Cloud -> Advanced, I set "Instance Cap" to 5

      I push changes to many branches (more than 5)

      In the sidebar, I see that more than 5 instances have been created.

      I expected that a maximum of 5 instances would be created.

      I am using EC2 spot instances in the ap-southeast-2 region. I have only one 'cloud' set up, and all the instances are building (different branches of) the same job.

      Please let me know if any other information would be helpful.

      (I see that this bug has been reported previously, but closed. Is this a regression? Am I doing something wrong?)

        Attachments

          Activity

          Hide
          abbm A B added a comment -

          Further monitoring suggests that the cap seems to struggle when multiple builds enter the queue simultaneously (or close to simultaneously). It looks like perhaps the plugin doesn't keep track of instances it has requested, only instances that are in the process of starting. So, if there's a lag between request and starting, it can request too many instances.

          That's just how it appears from the outside - I haven't examined the source code. Workaround for now is to set the instance cap at about half what you actually want it to be, and hope it doesn't exceed your true desired cap by too much.

          Show
          abbm A B added a comment - Further monitoring suggests that the cap seems to struggle when multiple builds enter the queue simultaneously (or close to simultaneously). It looks like perhaps the plugin doesn't keep track of instances it has requested, only instances that are in the process of starting. So, if there's a lag between request and starting, it can request too many instances. That's just how it appears from the outside - I haven't examined the source code. Workaround for now is to set the instance cap at about half what you actually want it to be, and hope it doesn't exceed your true desired cap by too much.
          Hide
          abbm A B added a comment -

          An update - the problem is definitely getting worse. With an instance cap of 1, I am routinely getting 10 or more slaves starting up. Only thing that has changed is AWS (I haven't changed the Jenkins configuration at all).

           

          Show
          abbm A B added a comment - An update - the problem is definitely getting worse. With an instance cap of 1, I am routinely getting 10 or more slaves starting up. Only thing that has changed is AWS (I haven't changed the Jenkins configuration at all).  

            People

            • Assignee:
              francisu Francis Upton
              Reporter:
              abbm A B
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: