Skip to content
Search Fedora

    Browse this documentation

    Tuning Fedora 45: zram and oomd are already on, tuned is not

    Before tuning anything, establish what is already done — otherwise you duplicate work or break a good default.

    zram, oomd and swappiness already active; tuned needs enabling

    Terminal window
    cat /proc/sys/vm/swappiness
    zramctl
    systemctl is-active systemd-oomd
    systemctl is-active tuned
    60
    NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
    /dev/zram0 lzo-rle 3.8G 2G 878.9M 896.9M [SWAP]
    active
    inactive

    Four things are already in place:

    ItemF45 defaultWhat it does
    zramenabled, lzo-rle, 3.8Gcompressed RAM used as swap, far faster than disk swap
    systemd-oomdactivekills processes under memory pressure instead of letting the machine thrash
    swappiness60kernel default
    tunednot runningyou install and enable it yourself

    tuned is Fedora’s automatic tuning daemon; the repository carries 2.28.0 and the measured transaction is 13 packages.

    Terminal window
    sudo dnf install tuned
    sudo systemctl enable --now tuned
    tuned-adm active
    Current active profile: virtual-guest

    It detects the machine type. On a virtual machine the default profile after enabling is virtual-guest, with no manual selection.

    List every profile:

    Terminal window
    tuned-adm list

    Measured: 15 profiles. The ones that matter:

    ProfileUse
    balancedgeneral purpose, the default
    desktopinteractive desktop work
    throughput-performancethroughput first, power saving off
    latency-performancelatency first
    virtual-guestvirtual machine guest (auto-selected here)
    powersavepower saving

    Switch:

    Terminal window
    sudo tuned-adm profile throughput-performance

    zram: already on, do not configure it twice

    Section titled “zram: already on, do not configure it twice”

    F45 creates the zram device through zram-generator, configured in /usr/lib/systemd/zram-generator.conf. It is enabled by default, so no manual setup is needed.

    Terminal window
    rpm -q zram-generator
    zram-generator-1.2.1-6.fc45.x86_64

    Only edit the configuration to change the size, then:

    Terminal window
    sudo systemctl daemon-reload
    sudo systemctl restart [email protected]
    Terminal window
    systemctl is-active systemd-oomd
    systemctl status systemd-oomd --no-pager | head -5

    It kills by cgroup memory pressure, intervening earlier and more selectively than the kernel OOM killer.

    An alternative is earlyoom (1.9.0), blunter but predictable:

    Terminal window
    sudo dnf install earlyoom
    sudo systemctl enable --now earlyoom

    Pick one. Running both means they race to kill your processes.

    ToolVersionPurpose
    htop3.5.3live process and memory view
    btop1.4.7prettier TUI including network and disks
    powertop2.15power draw and wakeup analysis
    Terminal window
    sudo dnf install btop htop powertop
    btop

    powertop needs root for complete data:

    Terminal window
    sudo powertop
    1. Look at the defaults: zramctl, systemctl is-active systemd-oomd — for most machines this is already enough
    2. Then decide on tuned: servers and VMs benefit; let it pick the profile
    3. Only then touch kernel parameters: vm.swappiness and friends, having noted the original value

    Persist a kernel parameter properly:

    Terminal window
    echo 'vm.swappiness = 10' | sudo tee /etc/sysctl.d/99-swappiness.conf
    sudo sysctl --system

    sysctl -w alone is temporary and disappears on reboot.

    SymptomCause
    tuned-adm cannot reach DBusthe daemon is not started
    swappiness change lost after rebootonly sysctl -w was used
    zram size change had no effectsystemd-zram-setup@zram0 was not restarted
    the machine still stallsoomd and earlyoom both running, or neither covers the actual bottleneck
    no performance change after tunedthe profile is balanced, which barely differs from default