Skip to content

Multiple "Out of memory" killings on speedy rsync backup #18050

@brauliobo

Description

@brauliobo

System information

Type Version/Name
Distribution Name CachyOS
Distribution Version rolling latest
Kernel Version 6.18.0
Architecture amd64
OpenZFS Version 2.3.5

Describe the problem you're observing

In a system with 192gb of RAM and only 25gb used (remaining was cache) during an rsync with speed over 200mb/s (megabytes per second), ZFS was triggering "Out of memory" killings as could be confirmed with dmesg logs. It started with Chrome, Cursor and bigger process but would not stop and kept killing many processes.

Setting primarycache=none or primarycache=metadata workarounds the issue
Users suggested configuring zfs_max_arc, which I didn't try.

The issue is that ZFS should not use that much memory and not checking kernel memory constraints. Also it should consider releasing memory for old stuff, like the Linux block cache.

Ideally it would be releasable memory like with the Linux block cache, and never capable of killing processes.

I can easily imagine ZFS killing a database like PostgreSQL that it is meant to serve. So the defaults zfs_max_arc=0 and all_system_memory - 1GB are really dangerous.

Related discussion: https://www.reddit.com/r/zfs/comments/1pkve4m/out_of_memory_on_fast_backup_operation/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: DefectIncorrect behavior (e.g. crash, hang)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions