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

systemd: Introduce systemd-oomd conf #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EliasTheGrandMasterOfMistakes

oomd.conf define a systemd oomd conf, service can
be enabled manually by user when enable
systemctl enable --now systemd-oomd

Based on https://www.reddit.com/r/archlinux/comments/mk2lg6/how_to_properly_configure_systemdoomd/?rdt=56355

Is possible too for separate it in a new package and enable this service in it.
A oomd.conf.d/ can be too prefered if be necessary

oomd.conf define a systemd oomd conf, service can
be enabled manually by user when enable
``` systemctl enable --now systemd-oomd  ```

Based on https://www.reddit.com/r/archlinux/comments/mk2lg6/how_to_properly_configure_systemdoomd/?rdt=56355
@ventureoo
Copy link
Member

I'm not against it, but, unfortunately, we offer in repositories kernels with PRJC schedulers that don't support PSI, which uses systemd-oomd to monitor the system load, so I'm not sure if we should enable that by default in cachyos-settings package.

@1Naim
Copy link
Member

1Naim commented Feb 19, 2025

so I'm not sure if we should enable that by default in cachyos-settings package

Not familiar with systemd-oomd so I need to look through some documentation to see what the conf is doing, but we could include the conf (if it's good) and just have systemd-oomd as an optional service to enable, i.e. what we have right now.

Copy link
Member

@ptr1337 ptr1337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally im fine with it.

Yes, prjc does need PSI, but not many users are using bmq and also would require additonal enabling of the service.

@EliasTheGrandMasterOfMistakes
Copy link
Author

I'm not against it, but, unfortunately, we offer in repositories kernels with PRJC schedulers that don't support PSI, which uses systemd-oomd to monitor the system load, so I'm not sure if we should enable that by default in cachyos-settings package.

can be good to warning first like a new doc page just to explain in details systemd-oomd?

@EliasTheGrandMasterOfMistakes
Copy link
Author

EliasTheGrandMasterOfMistakes commented Feb 21, 2025

so I'm not sure if we should enable that by default in cachyos-settings package

Not familiar with systemd-oomd so I need to look through some documentation to see what the conf is doing, but we could include the conf (if it's good) and just have systemd-oomd as an optional service to enable, i.e. what we have right now.

i'm not familiar too, but this reddit tip has worked for me
ManagedOOMMemoryPressure=kill is used to set default behaviour to kill in memory pressure threshold iirc.
ManagedOOMMemoryPressureLimit=70% is for memory pressure threshold limit usage, i has changed to 70% instead 50% to be not much agressive.
on manager looks that
DefaultCPUAccounting=yes
DefaultIOAccounting=yes
DefaultMemoryAccounting=yes
DefaultTasksAccounting=yes
is for accounting task for systemd-oomd i think is used cgroup for these
and for
SwapUsedLimitPercent=90%
DefaultMemoryPressureDurationSec=20s
i has changed to just 90% of swap to not be much agressive

@EliasTheGrandMasterOfMistakes
Copy link
Author

Personally im fine with it.

Yes, prjc does need PSI, but not many users are using bmq and also would require additonal enabling of the service.

Thank you

@notpentadactyl
Copy link

notpentadactyl commented Feb 22, 2025

after fzf made me go oom today, I'm all for this!

edit: that being said using this config, this command still gets me oom: systemd-run --user tail /dev/zero and nothing is getting killed. Unsure if I'm doing it wrong?!

@EliasTheGrandMasterOfMistakes
Copy link
Author

after fzf made me go oom today, I'm all for this!

edit: that being said using this config, this command still gets me oom: systemd-run --user tail /dev/zero and nothing is getting killed. Unsure if I'm doing it wrong?!

you have enable sudo systemctl enable --now systemd-oomd.service?
image

@notpentadactyl
Copy link

notpentadactyl commented Feb 23, 2025

after fzf made me go oom today, I'm all for this!
edit: that being said using this config, this command still gets me oom: systemd-run --user tail /dev/zero and nothing is getting killed. Unsure if I'm doing it wrong?!

you have enable sudo systemctl enable --now systemd-oomd.service?

Yes, I had it enabled, I also disabled and re-enabled it now, then I tried: systemd-run --user tail /dev/zero

image

image

At that point I did killall tail to not run out.

@EliasTheGrandMasterOfMistakes
Copy link
Author

EliasTheGrandMasterOfMistakes commented Feb 24, 2025

er tail /d

your system ram is really big, i think if you leave for some time the systemd-oomd will kill it but you can try with defaults from second comment in reddit

ManagedOOMMemoryPressure=kill
ManagedOOMMemoryPressureLimit=50%

you can try too:
DefaultOOMPolicy=kill

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.

5 participants