[SOLVED] PBS 4.2.14 – chunk lock files under /run/proxmox-backup/locks/<store>/.chunks never removed on S3 datastore → kernel slab exhaustion and OOM during GC

sistemisti5

Member
Nov 30, 2022
10
3
8
Hi all,


we are running a secondary PBS used as an offsite copy: an S3-backed datastore filled by a daily pull sync job, with about two months of retention. Garbage collection on this datastore never completes, and the VM eventually runs out of memory. After some investigation, the cause appears to be per-chunk lock files that are created in /run/proxmox-backup (tmpfs) and never removed.


Environment


  • Proxmox Backup Server 4.2.14 (Debian 13 "trixie"), VM with 6 vCPU and 64 GB RAM, running on Proxmox VE 9
  • One datastore with an S3 backend (pxaqbk-s3cold), about 405 backup groups and about 16,900 index files
  • Daily pull sync job from another PBS, plus a daily prune job
  • GC chunk digest cache capacity: 8388608 (we also tried the default; no difference regarding this issue)


root@pxaqrabkp02:~# proxmox-backup-manager versions --verbose
proxmox-backup 4.2.0 running kernel: 7.0.14-30-pve
proxmox-backup-server 4.2.14-1 running version: 4.2.14
proxmox-kernel-helper 9.2.1
proxmox-kernel-7.0 7.0.14-30
proxmox-kernel-7.0.14-30-pve-signed 7.0.14-30
proxmox-kernel-7.0.14-8-pve-signed 7.0.14-8
proxmox-kernel-7.0.14-4-pve-signed 7.0.14-4
proxmox-kernel-7.0.6-2-pve-signed 7.0.6-2
proxmox-kernel-7.0.0-3-pve-signed 7.0.0-3
ifupdown2 3.3.0-1+pmx14
libjs-extjs 7.0.0-9
proxmox-backup-docs 4.2.14-1
proxmox-backup-client 4.2.14-1
proxmox-enterprise-support-keyring 1.1
proxmox-mail-forward 1.2.0
proxmox-mini-journalreader 1.7
proxmox-offline-mirror-helper 0.8.0
proxmox-widget-toolkit 5.2.15
pve-xtermjs 6.0.0-3
smartmontools 7.5-pve2
zfsutils-linux 2.4.4-pve1
root@pxaqrabkp02:~#

What happens


  1. GC phase 1 (mark) completes normally in about 50–65 minutes.
  2. GC phase 2 (sweep) starts and runs for several hours.
  3. During this time, kernel unreclaimable slab memory grows continuously until the OOM killer kills proxmox-backup-proxy, and the GC task ends with status unknown.

From the kernel and systemd logs:



kernel: Out of memory: Killed process 708 (proxmox-backup-) total-vm:3958996kB, anon-rss:8kB, file-rss:1636kB, shmem-rss:0kB, UID:34 ...
systemd[1]: proxmox-backup-proxy.service: A process of this unit has been killed by the OOM killer.
systemd[1]: proxmox-backup-proxy.service: Consumed 18h 21min 16.005s CPU time, 48.1G memory peak, 1.9G memory swap peak.

The same happens during sync jobs, though more slowly. Our current workaround is a scheduled reboot of the VM before each sync, which in turn makes it impossible for GC to ever finish.


Analysis


After the proxy was restarted by systemd, the process itself only used about 28 MB RSS, but memory was still not freed:



MemAvailable: 18213332 kB
AnonPages: 27152 kB
Shmem: 4684 kB
Slab: 59691132 kB
SReclaimable: 13725068 kB
SUnreclaim: 45966064 kB

slabtop shows about 47.7 million tmpfs inodes:



OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
47765187 47765172 99% 0.75K 2286839 21 36589424K shmem_inode_cache
47771493 47770399 99% 0.19K 2274833 21 9099332K dentry
47796852 47771490 99% 0.09K 1039062 46 4156248K lsm_inode_cache

These belong to the tmpfs mounted on /run/proxmox-backup, which is mounted without an inode limit, so df -i shows 0. Practically all the files are under:



/run/proxmox-backup/locks/pxaqbk-s3cold/.chunks/

That is, one lock file per chunk. They are not removed after the chunk operation completes, nor when the task finishes, nor when proxmox-backup-proxy is restarted. Each file costs about 1.2 KB of unreclaimable kernel memory, so a GC that touches every chunk of a large datastore needs tens of GB of RAM just for these lock files. Only a reboot, which clears the tmpfs, frees the memory.


We checked apt list --upgradable and the package changelog, and could not find a related fix.


Questions


  1. Is this a known issue with S3-backed datastores in 4.2.x? Is a fix planned?
  2. Is it safe to delete the contents of /run/proxmox-backup/locks/<store>/.chunks/ while proxmox-backup-proxy is stopped, as a faster workaround than rebooting the VM?
  3. Until a fix is available, is there a recommended way to let GC complete on such a datastore, other than temporarily adding a lot more RAM?

We can provide more logs or run additional diagnostics if needed.


Thanks!