Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does travis-ci.org throttle builds?

Tags:

travis-ci

My company is using travis-ci.org (the free version for open source software) to automatically build pull requests to our repository on github. We have about 20 people submitting Pull Requests to the same repo throughout the day and each of these gets built in a matrix that includes two Build Jobs per Build. We often notice that it takes a number of minutes—and sometimes hours—for a build to start once it's been sent to travis. (Symptom: the build appears on travis but the timer doesn't start and there's no console output for a while.)

I assume this happens because the travis-ci.org is either backed up or throttles builds. First of all

  • Does travis intentionally throttle/rate-limit builds?

If so, how are builds throttled?

  • Per login? (i.e. per github user/organization, etc.)
  • Per repo?

Are builds throttled

  • Per "Build"?
  • Per "Build Job"?

Knowing this will let us optimize our build time-to-finish within the constraints travis-ci.org has set (which is hopefully aligned with playing nice as a free user).

like image 230
Danny Roberts Avatar asked Apr 10 '15 17:04

Danny Roberts


People also ask

How do you speed up Travis CI?

To speed up a test suite, you can break it up into several parts using Travis CI's build matrix feature. Say you want to split up your unit tests and your integration tests into two different build jobs. They'll run in parallel and fully utilize the available build capacity for your account.

How many people use travis ci?

Travis CI is a software-testing solution used by over 900,000 open source projects and 600,000 users.

Is travis ci free?

You most certainly can! And you get 1 month for free – 12 months for the price of 11! Simply select the annual option when signing up for a subscription, or go to travis-ci.com if you wish to switch your current plan to annual.


2 Answers

Travis-CI currently provides five concurrent builds for open source projects, and this is counted against all repositories per GitHub login or organization, as the Apache Software Foundation discovered. Travis counts each "build job", across all projects and pull requests, towards this limit on concurrent builds.

like image 38
shoyer Avatar answered Sep 18 '22 09:09

shoyer


If you check out the travis-ci status page (http://www.traviscistatus.com/) you'll notice that the "Active Linux Builds for Open Source projects" periodically maxes out. Based on how the travis private build system works (a single queue for all "Build Jobs" with no more than x running at a time), I suspect they have a single queue for all open source Build Jobs.

You can split up your build in to multiple jobs, each of which would finish faster. When Travis is under light use they would run in parallel and your build will return sooner, but when Travis is running lots of other builds yours may only run sequentially.

Looking at the .travis.yml in the repo you posted, you may notice good performance increases by adding apt and pip caching (http://docs.travis-ci.com/user/caching/). You should also consider switching to Travis' new container-based infrastructure (http://docs.travis-ci.com/user/workers/container-based-infrastructure/). That will only work however if you're able to replace the sudo apt-get commands in your build.

like image 120
MattyB Avatar answered Sep 19 '22 09:09

MattyB