gutschilla

gutschilla

CI/CD: What's the fastest CPU for Elixir compilation?

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!

Marked As Solved

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.

Also Liked

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.

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

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.

Last Post!

dimitarvp

dimitarvp

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

Where Next?

Popular in Questions Top

vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36820 110
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31586 112
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New

We're in Beta

About us Mission Statement