Thoughts on `mix complie` getting `Killed` on my build machine (Linode)?

During a recent deploy I had an issue when the mix compile command seemed to be getting Killed while trying to compile my dependency: html_sanitize_ex. I was a repeatable error after trying to mix clean and mix.deps.clean --all and redoing it — eventually it just worked but I don’t know why mix was getting Killed. I tried to run the command with --trace but it did not add any extra output. I suspect the compilation of html_sanitize_ex was pushing my $5/mo Linode build server too hard and the machine killed what it thought was a runaway process but can’t confirm with evidence. Any thoughts?

5$ seems to be very limited on RAM, perhaps its getting shoot by the OOM killer? Have a second terminal open and use htop or similar tools to observe RAM usage.

If possible try to compile on a bigger machine, perhaps a local docker, pushing the built artifact to linode then?

2 Likes

Thanks for the tip. I’ll give it a try next time I deploy.

This is a half built solution at the moment and I have been learning Docker on the side. Hope to migrate to something more bullet proof soon™.

Compiling on low end (1GB) VPS is certainly doable, including compiling elixir itself. I do that all the time. You just need to be careful of what are you running at the same time, like stop your application, shut down database, etc. I actually consider this is a strong point for elixir: low-end friendliness.

Just closing the thread a bit, I did a new deploy today and ran htop in a second terminal as was suggested.

I noticed a huge memory spike during compilation when it got to html_sanitize_ex. It did survive by utilizing the swap disk but since that is only 512MB itself I suspect this was the reason I had Killed troubles before.

I’ll pass along a note to the html_sanitize_ex so they can do some further investigation and try to replicate my observed behavior.

Thanks so much for all the help.

1 Like