anchor.diff: -# Parallelizing Builds
  +# Parallelizing Jobs
   
  -Running build jobs in parallel is a simple technique to decrease your build’s total running time. This guide will show you how to use Buildkite’s support for multiple agents and job parallelism to increase the speed of your builds.
  +Running a build's jobs in parallel is a simple technique to decrease your build’s total running time. This guide will show you how to use multiple agents and job parallelism to increase the speed of your builds.
   
   <%= toc %>
   
   ## Running multiple agents
   
  -The Buildkite agent support the running of multiple instances on the one machine, as well as scaling your agents horizontally across any number of machines and networks.
  +The Buildkite agent supports the running of multiple instances on the one machine, as well as scaling your agents horizontally across any number of machines and networks.
   
  -Each platform’s [install instructions](/docs/agent/installation) has details for how to run multiple agents on a machine. In this case we'll use the [Ubuntu-based build agent](/docs/agent/ubuntu) to start 5 instances of the Buildkite agent:
  +The steps for running multiple agents are slightly different for each platform. Automated installers and detailed instructions can be found in the [installation](/docs/agent/installation) section. For this example we'll use a [Ubuntu-based build agent](/docs/agent/ubuntu) to start 5 instances of the Buildkite agent:
   
   ```bash
   # After running the standard install instructions...
  
positive.code: 
  <%= image 'parallelism.png', size: '555x138', alt: 'Step parallelism field' %>
  
  Whilst we’re here we can also update the name of the step to include `%n`, which will automatically have the number substituted in and will help to differentiate between the different build jobs:
  
  <%= image 'name.png', size: '555x80', alt: 'Step name field with %n' %>
  
  Now the pipeline is configured we can create a new build:
  
  <%= image 'build.png', size: '405x204', alt: 'The build' %>
  
  
negative.code: 
  ## Auto-scaling your build agents
  
  We provide a number of APIs for automatically scaling agents based on you build queue.
  
  * Using the [Pipelines API](/docs/api/pipelines) you’re able to fetch the `scheduled_jobs_count`, `waiting_jobs_count` and `running_jobs_count` to get an overview of the number of jobs waiting to be run. Keeping track of this value, you can spin new agent machines up or down to accomodate the job load.
  * Using [agent prioritization](/docs/agent/prioritization) you’ll able to define which agents are assigned work first, as well as lower priority agents which you may spin up and down on demand.
  * Using the [Agents API](/docs/api/agents) you’re able to fetch your agent’s `job` and `last_job_finished_at`, which allow you to see if they have been idle. Using the [agent stop API](/docs/api/agents#stop-an-agent) you can remotely shut down idle agent processes (passing `"force": false` to ensure it won’t cancel any running job).
  
  Using these three APIs you can automate your build infrastructure, scale your agents based on demand, and ensure no-one has to wait for their build to start.
  