Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add earlyoom to dev desktop #480

Merged
merged 3 commits into from
Sep 6, 2024
Merged

Conversation

Noratrieb
Copy link
Member

Sometimes the dev desktop just OOMs and dies because someone committed a happy little accident, as one does. Luckily Linux has an OOM killer, sadly it's pretty useless in practice.

Luckily there's a userspace workaround! It works really well.

I don't know if we want any config for it. I set the freeSwapThreshold to 100 on my own computer to never swap before killing, I don't know if that would matter for the dev desktop. I think it makes sense to keep it at the default for now unless that causes problems.

@Noratrieb
Copy link
Member Author

@pietroalbini was complaining to me about the dev desktop dying sometimes and told me i should do this uwu hi

@marcoieni marcoieni self-assigned this Sep 2, 2024
@marcoieni
Copy link
Member

marcoieni commented Sep 5, 2024

Hey Nora, thank you for contributing!
I tested it on our staging dev desktops by running ./x check and earlyoom killed the process almost immediately (the staging desktop only has 1GB of memory 😅).

So this looks good to me. Let's try it with default settings as you said and let's see how it goes. If people complain that their processes get killed too often we can re-evaluate this :)

Just one thing. Instead of adding a task like you did, I think it's cleaner if you add earlyoom to this list:

What do you think?

For anyone else. This is the gist of what earlyoom does (from their readme):

earlyoom checks the amount of available memory and free swap up to 10 times a second (less often if there is a lot of free memory). By default if both are below 10%, it will kill the largest process (highest oom_score).

Sometimes the dev desktop just OOMs and dies because someone committed a
happy little accident, as one does. Luckily Linux has an OOM killer,
sadly it's pretty useless in practice.

Luckily there's a userspace workaround! It works really well.
@marcoieni marcoieni merged commit ba38b18 into rust-lang:master Sep 6, 2024
3 checks passed
@marcoieni
Copy link
Member

I installed earlyoom in all dev-desktops. You can verify this by running systemctl status earlyoom.
Thanks for your contribution Nora! 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants