gutschilla

gutschilla

Hi,

I want to minimize the time required for the most-costly compilation step in our CI/CD environment.

Right now, We’re on GitLab using their runners to be installed on own machines. I tried with Kubernetes clusters on GCP and the Gitlab-provided runners and while this all runs fine and scales nicely horizontally, I am looking for quick build and test times. In our setup, the build step (fetching deps, comiling deps and own sources) takes the most time: a few minutes, depending on the project.

So I am looking into dedicated hardware for our gitlab runners where the major workload will be mix compile :computer: . Since the team isn’t big I don’t really need all the auto-scaling a Kubenetes cluster has to offer. I want quick result for individual builds from scratch.

Should I go many cores or for high single-core performance? Other than that I’ll go for local SSD storage and plenty of RAM (64GB).

Thanks for your insights!

Showing Posts 1 to 10

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

The biggest thing when making a CI/CD fast is minimizing the work that you need to do each time. If you’re having to compile all the dependencies from scratch every time, the biggest win will come from finding a way to cache that, regardless of what CPUs are available. We have a large project, but the actual compilation step takes < 10 seconds in our CI unless we are changing a dependency.

gutschilla

gutschilla OP

Very True! Thanks a lot. We already cache _build until mix.lock changes. What do you do to cache? Any more insights?

We also have a lot of git submodules in place for which we currently cannot track for changes – this surely can be tweaked somehow.

Still, getting build + test done even 10 seconds faster would greatly improve the process here for a lot lot unresolved reasons circling around the testability on developer machines. And while we’re of course going to fix those problems at some point I am looking for ways to have us more productive even at this stage.

In the short term simply adding more CPU power is an option to me as we can just buy it w/o someone to make it. So again, any insights on which hardware to get?

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Fair enough! The Elixir compiler is parallel, so you should be able to benefit from multiple cores. SSD speed is of course critical. 64gb of ram is wildly more than enough.

LostKobrakai

LostKobrakai

…until it hit’s compile time dependencies. So checking those and cutting them at certain places can also improve compilation times (in cached scenarios).

gutschilla

gutschilla OP

Alirght, I’ll try with both

  • i9-9900K (8 cores)
  • Ryzen7 1700X (8 cores)

both with 64GB of RAM at a comparable price (~70EUR/mo) and will let you know the results.

If the improvement is big enough I’ll give the EPYC 7401P (24 cores) at 200€/mo a shot.

Thanks @benwilson512 and @LostKobrakai for sharing your insights!

sorentwo

sorentwo

Oban Core Team

Tiered caches will help with the build time a lot. On CircleCI, even with small test runners, you are able to cache the hex deps, the compiled code, and PLT files if dialyzer is your thing.

I do this for all my applications, but here is an example for an open source project:

https://github.com/sorentwo/oban/blob/master/.circleci/config.yml

dimitarvp

dimitarvp

In terms of CPUs, I found the AMD Threadripper series quite good for compilation and overall dev work. Best results so far however I achieved with recent Xeon CPUs. They have bigger L1 / L2 / L3 caches than most consumer CPUs and I found them to be extremely adequate for compiling.

I’d say go for a Threadripper or a Xeon with at least 8 physical cores and a NVMe / PCI SSD (> 2 GB/s read/write speed). RAM isn’t of huge consequence for a compilation / CI machine. Even 16GB would be an overkill, unless the machine is also a dev machine and I misread you.

dimitarvp

dimitarvp

To follow up, on a Xeon 2150B (10/20 cores):

$ time mix compile --force
Compiling 418 files (.ex)
Generated <our_company_app> app
mix compile --force  76.51s user 16.60s system 664% cpu 14.020 total

To be honest, I expected the Elixir compiler to be able to utilise all cores. :confused:

Still pretty fast though.

NobbZ

NobbZ

It probably will be able to, but this is only possible if there is not a single compile time dependency between modules.

dimitarvp

dimitarvp

Yep, I’ve heard the dependency graph can severely impact the parallelisation of compilation
and it makes sense.

— All posts loaded —

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
mnkhod
So i have been using ash framework for a while and i love it. However currently the issue im having with ash framework is the error handl...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New

Other Trending Topics Top

Potions
A new screencast on live LiveView updates with PubSub, the Oban Web dashboard, and smarter retries. Part 2 of 2. Screencast + full walkth...
New
GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews