5f9cb29c3a
Reported in the community forum [0]. By default, there can be large amounts of memory left assigned to the QEMU process after backup. Likely because of fragmentation, it's necessary to explicitly call malloc_trim() to tell glibc that it shouldn't keep all that memory resident for the process. QEMU itself already does a malloc_trim() in the RCU thread, but that code path might not be reached (or not for a long time) under usual operation. The value of 4 MiB for the argument was also copied from there. Example with the following configuration: > agent: 1 > boot: order=scsi0 > cores: 4 > cpu: x86-64-v2-AES > ide2: none,media=cdrom > memory: 1024 > name: backup-mem > net0: virtio=DA:58:18:26:59:9F,bridge=vmbr0,firewall=1 > numa: 0 > ostype: l26 > scsi0: rbd:base-107-disk-0/vm-106-disk-1,size=4302M > scsihw: virtio-scsi-pci > smbios1: uuid=b2d4511e-8d01-44f1-afd6-9581b30c24a6 > sockets: 2 > startup: order=2 > virtio0: lvmthin:vm-106-disk-1,iothread=1,size=1G > virtio1: lvmthin:vm-106-disk-2,iothread=1,size=1G > virtio2: lvmthin:vm-106-disk-3,iothread=1,size=1G > vmgenid: 0a1d8751-5e02-449d-977e-c0160e900231 Before the change: > root@pve8a1 ~ # grep VmRSS /proc/$(cat /var/run/qemu-server/106.pid)/status > VmRSS: 370948 kB > root@pve8a1 ~ # vzdump 106 --storage pbs > (...) > INFO: Backup job finished successfully > root@pve8a1 ~ # grep VmRSS /proc/$(cat /var/run/qemu-server/106.pid)/status > VmRSS: 2114964 kB After the change: > root@pve8a1 ~ # grep VmRSS /proc/$(cat /var/run/qemu-server/106.pid)/status > VmRSS: 398788 kB > root@pve8a1 ~ # vzdump 106 --storage pbs > (...) > INFO: Backup job finished successfully > root@pve8a1 ~ # grep VmRSS /proc/$(cat /var/run/qemu-server/106.pid)/status > VmRSS: 424356 kB [0]: https://forum.proxmox.com/threads/131339/ Co-diagnosed-by: Friedrich Weber <f.weber@proxmox.com> Co-diagnosed-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com> |
||
---|---|---|
.. | ||
0001-PVE-Config-block-file-change-locking-default-to-off.patch | ||
0002-PVE-Config-Adjust-network-script-path-to-etc-kvm.patch | ||
0003-PVE-Config-set-the-CPU-model-to-kvm64-32-instead-of-.patch | ||
0004-PVE-Config-ui-spice-default-to-pve-certificates.patch | ||
0005-PVE-Config-glusterfs-no-default-logfile-if-daemonize.patch | ||
0006-PVE-Config-rbd-block-rbd-disable-rbd_cache_writethro.patch | ||
0007-PVE-Up-glusterfs-allow-partial-reads.patch | ||
0008-PVE-Up-qemu-img-return-success-on-info-without-snaps.patch | ||
0009-PVE-Up-qemu-img-dd-add-osize-and-read-from-to-stdin-.patch | ||
0010-PVE-Up-qemu-img-dd-add-isize-parameter.patch | ||
0011-PVE-Up-qemu-img-dd-add-n-skip_create.patch | ||
0012-qemu-img-dd-add-l-option-for-loading-a-snapshot.patch | ||
0013-PVE-virtio-balloon-improve-query-balloon.patch | ||
0014-PVE-qapi-modify-query-machines.patch | ||
0015-PVE-qapi-modify-spice-query.patch | ||
0016-PVE-add-IOChannel-implementation-for-savevm-async.patch | ||
0017-PVE-add-savevm-async-for-background-state-snapshots.patch | ||
0018-PVE-add-optional-buffer-size-to-QEMUFile.patch | ||
0019-PVE-block-add-the-zeroinit-block-driver-filter.patch | ||
0020-PVE-Add-dummy-id-command-line-parameter.patch | ||
0021-PVE-Config-Revert-target-i386-disable-LINT0-after-re.patch | ||
0022-PVE-Up-Config-file-posix-make-locking-optiono-on-cre.patch | ||
0023-PVE-monitor-disable-oob-capability.patch | ||
0024-PVE-Compat-4.0-used-balloon-qemu-4-0-config-size-fal.patch | ||
0025-PVE-Allow-version-code-in-machine-type.patch | ||
0026-block-backup-move-bcs-bitmap-initialization-to-job-c.patch | ||
0027-PVE-Backup-add-vma-backup-format-code.patch | ||
0028-PVE-Backup-add-backup-dump-block-driver.patch | ||
0029-PVE-Add-sequential-job-transaction-support.patch | ||
0030-PVE-Backup-Proxmox-backup-patches-for-QEMU.patch | ||
0031-PVE-Backup-pbs-restore-new-command-to-restore-from-p.patch | ||
0032-PVE-Add-PBS-block-driver-to-map-backup-archives-into.patch | ||
0033-PVE-redirect-stderr-to-journal-when-daemonized.patch | ||
0034-PVE-Migrate-dirty-bitmap-state-via-savevm.patch | ||
0035-migration-block-dirty-bitmap-migrate-other-bitmaps-e.patch | ||
0036-PVE-fall-back-to-open-iscsi-initiatorname.patch | ||
0037-PVE-block-stream-increase-chunk-size.patch | ||
0038-block-io-accept-NULL-qiov-in-bdrv_pad_request.patch | ||
0039-block-add-alloc-track-driver.patch | ||
0040-Revert-block-rbd-workaround-for-ceph-issue-53784.patch | ||
0041-Revert-block-rbd-fix-handling-of-holes-in-.bdrv_co_b.patch | ||
0042-Revert-block-rbd-implement-bdrv_co_block_status.patch | ||
0043-alloc-track-fix-deadlock-during-drop.patch | ||
0044-migration-for-snapshots-hold-the-BQL-during-setup-ca.patch | ||
0045-savevm-async-don-t-hold-BQL-during-setup.patch |