-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
sio_cache_0 kernel slab high memory usage during scrub #8662
Comments
@mailinglists35 thanks for reporting this. The
It wasn't clear from the mailing list thread how much memory is in your system. Could you include that information as well. You can further reduce the amount of memory ZFS is allowed to use for the scan by setting the
|
the system has 16GB physical RAM when slabtop reports 3GB (which is ~20% of ram), the output of the requested command is:
I will update as well then it reaches the peak. |
I can't seem to be able to trigger it again, but please leave this open until fragmentation - if that was the cause - gets high enough to occur again |
@mailinglists35 Even 20% is 15% higher than it should be. Can you please do the following to enable dbgmsg logging and the contained dprintf messages:
Then please provide the all of the relevant dbgmsg logs like this:
|
thank you, will do that. related, I stumbled upon this:
does that still apply to current master? to accurately measure the data, should I boot with |
I wouldn't change anything from default until we have a better understanding of what's going on. One of the statements in dbgmsg will look something like this:
This includes almost all of the memory currently being used by the scan, which is primarily the sio caches but includes other things as well, so don't expect the numbers to line up exactly. If this number is less than the total memory usage of all the sio caches that would be reason to start looking at the SPL and memory allocator. At that point I would say we should try the tunables you mentioned, but I want to sanity check that the scanning code's memory limiting is working properly in the first place. |
@mailinglists35 any update o n this? |
I can't make it use again 10..12GB :( |
if this is an issue, I can close then reopen when it occurs again |
@mailinglists35 should i close this issue? |
related comment for the archives... |
@tcaputi if it prevents release or gives other administrative troubles, please close. but later can I reopen or re-start talk here without having to open a new issue? |
Yes, that's fine. |
I think I'm experiencing this on a homelab/test server now (Proxmox 7.4.17, zfs zfs-2.1.11-pve1). Happening on a disk resilver. It also happens during a scrub, which I had to abort (the slab freed up when aborted). Admittedly this is a low-memory node (8GB) but the rate it runs out when busy with the scanning part of resilvering sees it eat that memory up fast, like in a matter of minutes. I've attached two screenshots of btop, slabtop, zpool status and meminfo output about a minute apart to show the rate that it balloons out. The load on this node is some storage (Linstor) but no active VMs or containers (evacuated because of the instability). While typing this I noticed there's a version mismatch between zfs-utils (2.1.11-pve1) and the kernel module (2.1.9-pve1), despite all packages being up-to-date. It's part of a three-node cluster, it's the same versions across all nodes, but node 2 seems to be the only node suffering from this. Nodes 1 and 3 completed weekly scrubs on Sunday without issue, but Node 2 OOMed and paniced as above. Any suggestions what to look for next to isolate/debug this? |
In the meantime I've stumbled across the zfs_scan_mem_lim_fact and _soft_fact paramaters which seem relevant, here: https://openzfs.github.io/openzfs-docs/Performance%20and%20Tuning/Module%20Parameters.html#zfs-scan-mem-lim-fact |
@awnz IIRC scrub should log some status updates to dbgmsg in procfs on every txg. Seems it should also report memory usage there if ZFS module is built with ZFS_DEBUG and you enable dprintf's via |
It seems not to be compiled with debug. I've installed the relevant packages and will have another go at this this weekend. In the meantime my dirty workaround is Went for options zfs zfs_scan_legacy=1 instead. Since a scrub seems to result in the same behaviour, I'll retest with Proxmox debug packages installed and no workload on this node this weekend and report back. (edit 19/10: sorry was unable to test last weekend, will try again when I can) |
System information
Describe the problem you're observing
detailed attachments on https://zfsonlinux.topicbox.com/groups/zfs-discuss/T225c012532a7c86c (arc_summary, /proc/spl/kmem/slab, dmesg)
when I scrub the pool (10TB 3-way mirror with ssd cache and ssd log), I observe that kernel slab memory occupied by
sio_cache_0
fills up to the point where kernel starts oom killer on innocent appsthese slabs show as unreclaimable in oom killer dmesg
if I setup
spl_kmem_cache_expire
to 0x01 (illumos style, 15 seconds aging return of objects), the memory consumption stabilizes around 3GB - down from 10GB with default 0x02 -, but I find that still enormously.Does
sio_cache_0
really need all that ram during scrub?Describe how to reproduce the problem
zpool scrub poolname
Include any warning/errors/backtraces from the system logs
The text was updated successfully, but these errors were encountered: