Bamboo Best Practice - Using Agents

General overview

We've already had a look at how we can improve Bamboo's efficiency in the Using stages and Sharing artifacts best practice guides, so here we're going to have a look at how we can improve raw build speeds using Bamboo agents.

Let's consider this simple Bamboo scenario:

Imagine a set of plans that we have developed and are queued, awaiting a build agent to become available to execute the build. This is great, and exactly what Continuous Integration is all about, but we notice that certain plans seem to sit and wait consistently longer than others. This has the effect of slowing our progress and may be felt later down our development streamline. But why is it happening? And what can we do about it?

Let's examine exactly what's going on.

Each build agent offers a set of capabilities, and each plan will have capability requirements that the build agent must meet. These could include a range of executables, tasks, and JDKs. Build agents are tailored to match specific plan requirements and as a result, not all agents can build all plans. Often, only a small subset of agents will meet all of the requirements for a specific plan. Typically, plans that demonstrate consistently long wait times, are the ones that are waiting for a specific combination of capabilities to become available.

The Build Queued Duration report tells us the average time that a plan sits in the queue until build agents become available to execute it. By examining the report, we can identify which builds are too slow, and also if we are sporting wasted capacity on our systems. So how does this help us, and how can we even out our wait times? Adding required capabilities to a greater number of agents helps to improve parallel builds and even out our build loading. We can achieve this in a number of ways.

Best practice approaches


Using remote agents

Why use remote agents?

Adding popular capabilities to more agents is one way to tackle our wait time problem. However, we can also take advantage of remote agents to boost our capabilities. By increasing the number of remote agents to the maximum allowed by our license tier, we can add significant amounts of available build capability which will in turn lead to reduced wait times. We could also consider using elastic agents on AWS.

The following graph shows how adding additional remote agents helped the Bamboo team to reduce build wait times for building Bamboo itself:

When build wait times approached 27 minutes in late 2011, adding additional remote agents with well defined capabilities reduced wait times to less than 10 minutes. The same is also true when wait times approached 33 minutes - additional remote agents ultimately reduced wait times back to less than 10 minutes.

Unknown capabilities

Sometimes remote agents have capabilities that are unknown, so Bamboo will not automatically utilize these when it's looking for agents for a build. Luckily, even if Bamboo doesn't know about these capabilities, we can quickly and easily detect them.

To identify the capabilities available on a remote agent:

  1. In the upper-right corner of the screen, select
    Administration bamboo administration icon
    > Overview.
  2. From the sidebar, under Build resources, select Server capabilities.
  3. On the Server capabilities page, select Detect server capabilities.

Adding remote agents

To add remote agents:

  1. In the upper-right corner of the screen, select
    Administration bamboo administration icon
    > Overview.
  2. From the sidebar, under Build resources, select Agents.
  3. On the Agents summary page, select Install remote agent.

Learn more about adding additional remote agents in the remote agent installation guide.

Monitoring agents

Build queued duration

The Build Queued Duration report shows how long each build is spending in the build queue, and is an important tool for evaluating build wait times. The build queued duration report also allows you to compare build wait time between different plans.

To access the report:

  1. From the top navigation bar, select ReportsReports.
  2. From the Report menu, select Build queued duration.
  3. Select the appropriate Build plans for analysis.
  4. Optionally, configure grouping and a date filter.
  5. Select Submit.

Build queued duration report page


Last modified on Mar 5, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.