Bug 1944646 - [oomd] CPU usage 1.3% is somewhat to high
Summary: [oomd] CPU usage 1.3% is somewhat to high
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 34
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2021-03-30 12:00 UTC by Artem
Modified: 2021-10-13 08:38 UTC (History)
18 users (show)

Fixed In Version: systemd-248.4-1.fc34
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2021-10-12 17:07:31 UTC
Type: Bug

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github facebookincubator oomd issues 79 0 None open High CPU usage 2021-03-30 12:00:01 UTC

Description Artem 2021-03-30 12:00:01 UTC
Description of problem:
  The new one 'systemd-oomd' is replaced old one 'earlyoom' in f34. The CPU utilization is to high compared with earlyoom. systemd-oomd consumes 0.7-1.3% on Ryzen CPU (Zen 2). earlyoom usage was nearly zero.
  This could negatively impact on laptop power usage and reduce battery life and power efficiency.
  Tested on Fedora 34 Workstation (GNOME). KDE users reporting the same results.

Version-Release number of selected component (if applicable):

How reproducible:
  $ sudo dnf install htop

  Look at current 'systemd-oomd` process CPU usage and TIME+ column.

Actual results:
  * Current CPU usage: 0.7-1.3%.
  * TIME+: in top after the 'gnome-shell' process.

Expected results:
  'systemd-oomd' CPU utilization is equal to 'earlyoom' or even less.

Comment 1 Zbigniew Jędrzejewski-Szmek 2021-04-02 14:04:17 UTC

Comment 2 Tad 2021-04-29 15:50:47 UTC
Can the patches in https://github.com/systemd/systemd/pull/19126 be considered for picking to Fedora 34 branch?
On older systems systemd-oomd is non-stop 6-10% CPU usage.
After a few hours of uptime, it consistently has more TIME+ then gnome-shell.

Comment 3 Fedora Update System 2021-05-08 09:17:07 UTC
FEDORA-2021-775e2373a1 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-775e2373a1

Comment 4 William Bader 2021-06-08 23:07:20 UTC
On my laptop with Fedora 34 and MATE Desktop, systemd-oomd has the second highest total CPU in top.
The only process with more CPU is Xorg, and systemd-oomd has about half of the total CPU as Xorg.
I have kernel 5.12.9-300.fc34.x86_64 and systemd-248.3-1.fc34.x86_64
The update from last month does not seem to have fixed the problem.

Comment 5 William Bader 2021-06-08 23:36:39 UTC
If I rarely run more than a few applications on my laptop, is there any danger with running `systemctl mask --now systemd-oomd.service`?

Comment 6 Zbigniew Jędrzejewski-Szmek 2021-06-25 11:25:54 UTC
(In reply to William Bader from comment #5)
> If I rarely run more than a few applications on my laptop, is there any
> danger with running `systemctl mask --now systemd-oomd.service`?

You don't need to mask it. 'systemctl disable --now systemd-oomd.service' is fine.
You can do 'systemctl enable --now earlyoom.service' afterwards to restore the mechanism
that was used before systemd-oomd. Using neither is also fine.

Comment 7 William Bader 2021-06-25 21:31:40 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #6)

> You don't need to mask it.

When I disabled systemd-oomd without masking it, it seemed to get restarted, I think by other units.

I notice when systemd-oomd is running because it burns enough CPU to keep my laptop's fan constantly running.

> Using neither is also fine.

Thanks. I have been running without either oom for over two weeks with no problems.

Comment 8 Zbigniew Jędrzejewski-Szmek 2021-07-07 20:25:25 UTC
systemd-249-1.fc35 might improve the situation. I'll backport the patches to f34 later on.

Comment 9 Zbigniew Jędrzejewski-Szmek 2021-10-12 17:07:31 UTC
systemd-248.4-1.fc34 included the patch to improve oomd resource usage:
* 50fe0594d2 oomd: don't collect candidate stats on every interval

I hope this is fixed now. If now, please open a new bug.

Comment 10 Artem 2021-10-13 08:38:56 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #9)

Thanks for info. Can't test in f34 now, but it's definitely fixed on f35 and new Systemd. 43 seconds CPU time used per 24 hours. Great!

Note You need to log in before you can comment on or make changes to this bug.