-
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
Possible memory leak on ZFS ZVOL as source image format and qemu-img convert. #7235
Comments
Could you try to reproduce it with e9a7729 ? |
I wonder if 03b60ee would also help edit: my theory is that qemu is using linux buffer/cache and not returning them when finished, this would normally be okay for non-zfs systems, but on zfs this forces an arc eviction, and the cache sits around forever doing nothing. |
@chrone: if you need a test PVE kernel with either (or both) of these
commits cherry-picked, feel free to ping me.
|
@gmelikov @bunder2015 Thanks for the tips, unfortunately, I'm no good at compiling ZFS from scratch especially on PVE kernel. @Fabian-Gruenbichler Whoa, this is great. Sure, I could do a test on the PVE kernel. Are you Fabian from Proxmox staff? If you are then I could leave a message on Proxmox forum. |
@chrone81 I believe you should have 03b60ee already as part of 0.7.x, however its disabled by default. Setting edit:
|
Hi @bunder2015 thanks for pointing that out. The memory buffered pages are removed when the 'qemu-img convert' is finished or cancelled though. I just tested with 100 or 500 and it didn't help limit the buffered pages used by qemu-img convert. The memory buffered pages keeps growing and spilled to swap over time. |
My apologies, it must only work on cache then (rather than both cache and buffers). |
PVE 5 kernel with #7170 backported: md5/sha256sum:
|
I think this is only tangentially ZFS related, as I can still reproduce it on a test system with #7170 included. @chrone81: do you see an improvement if you manually re-try the qemu-img command (you might have to create the target zvol first if it does not exist already), but add "-t none -T none" before the zvol paths? I think qemu-img just has a very bad choice of default caching mode, which should be fixable on the calling side... |
try again with memcg / memory controller enabled. maybe like this |
Just tested without the patched PVE kernel and with the qemu-img convert -t none and -T none options. The RAM usage is normal as in attached screenshot. I'll test with the patched kernel and report back later. @fcicq Unfortunately, I didn't test this with Linux containers yet. |
@Fabian-Gruenbichler using the ZFS patched PVE kernel didn't help. Only with the qemu-img convert -t none and -T none options did fix this issue. |
this fixes an issue with zvols, which require cache=none and eat up all free memory as buffered pages otherwise openzfs/zfs#7235 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
System information
Type | Version/Name
Distribution Name | Proxmox VE
Distribution Version | 5.1-41
Linux Kernel | 4.13.13-6-pve
Architecture | amd64
ZFS Version | 0.7.6-1
SPL Version | 0.7.6-1
Describe the problem you're observing
"qemu-img convert" will use all available memory as buffered pages if the source image is bigger than total memory and is in ZFS ZVOL image format. This causes high swapping activity and overall system slow down.
This issue only happens on "qemu-img convert" with ZFS ZVOL as the source image format. Is this some kind of memory leak or just a bug from qemu-img or bug ZFS?
Describe how to reproduce the problem
On host with 32GB RAM and ZFS zpool mirror on 2 spinning drives, the problem is reproducible every time:
Include any warning/errors/backtraces from the system logs
Didn't notice any error listed in syslog when the overall system gets slow down and high swap usage occurred.
The text was updated successfully, but these errors were encountered: