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

Earlyoom doesn't work #307170

Open
SamLukeYes opened this issue Apr 27, 2024 · 1 comment
Open

Earlyoom doesn't work #307170

SamLukeYes opened this issue Apr 27, 2024 · 1 comment

Comments

@SamLukeYes
Copy link
Member

Describe the bug

I enabled earlyoom, but it doesn't trigger under high memory pressure, and the kernel OOM killer activated instead.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Enable earlyoom
  2. Make sure earlyoom is running by systemctl status earlyoom
  3. Run tail /dev/zero
  4. Check earlyoom's log by journalctl -u earlyoom | grep sending

Expected behavior

Earlyoom kills the process and logs something like Feb 20 10:59:34 debian earlyoom[10231]: sending SIGTERM to process 7378 uid 1000 "tail": oom_score 156, VmRSS 4962 MiB, as explained in its README.

Screenshots

图片

Additional context

I also have zramSwap.enable = true set. Not sure whether it is relevant.

Notify maintainers

@AndersonTorres

Metadata

  • system: "x86_64-linux"
  • host os: Linux 6.6.28-xanmod1, NixOS, 24.05 (Uakari), 24.05pre-git
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.18.2
  • nixpkgs: /etc/nix/inputs/nixpkgs

Add a 👍 reaction to issues you find important.

SamLukeYes added a commit to SamLukeYes/nixos that referenced this issue Apr 28, 2024
@SamLukeYes
Copy link
Member Author

It seems this issue is related to xanmod kernel. Switched to the default kernel and the issue is gone.

However, the following test doesn't reproduce the issue 😕

{ nixpkgs ? <nixpkgs> }:

let
  pkgs = import nixpkgs {};
in
pkgs.testers.runNixOSTest {
  name = "earlyoom";

  nodes.machine = {
    boot.kernelPackages = pkgs.linuxPackages_xanmod;
    services.earlyoom = {
      enable = true;
    };
    zramSwap.enable = true;
  };

  testScript = ''
    cmd = "tail /dev/zero"
    machine.wait_for_unit("earlyoom.service")
    machine.execute(cmd, timeout = 30)
    machine.succeed(f"journalctl -u earlyoom.service | grep '{cmd}'")
  '';
}

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

No branches or pull requests

1 participant