Hello,
I have urbackup 2.4 setup with several clients. It works well. That’s a very nice app.
I face a difficulty on one of my client.
During backup, memory call is going so high that it pushes data to swap.
Let see below my munin graph
The blue line above is committed.
Is there any solution to decrease that memory consuption ?
Knuuut
December 14, 2022, 11:32am
#2
Hello @francoisPE ,
I solved this by editing /usr/lib/systemd/system/urbackupclientbackend.service
[Service]
ExecStart=/usr/local/sbin/urbackupclientbackend --config /etc/default/urbackupclient --no-consoletime
User=root
MemoryAccounting=true
MemoryHigh=2G
MemoryMax=3G
MemorySwapMax=512M
After this run
systemctl daemon-reload
systemctl restart urbackupclientbackend.service
Change the settings according to your needs.
Best
Knut
I set it up !
That’s very nice.
I gonna propose a PR
FrançoisPE
I propose that code for an automatic change
TOTAL_PHYSICAL_MEM=$(awk '/^MemTotal:/ {print $2}' /proc/meminfo)
TOTAL_SWAP=$(awk '/^SwapTotal:/ {print $2}' /proc/meminfo)
file=/usr/lib/systemd/system/urbackupclientbackend.service
cp $file $file"_bak"
gawk -v memkb=$TOTAL_PHYSICAL_MEM -v swapkb=$TOTAL_SWAP '{ if ($0 ~ /User=root/){printf("User=root\nMemoryAccounting=true\nMemoryHigh=%.0fG\nMemoryMax=%.0fG\nMemorySwapMax=%.0fM\n",memkb*40/100/(1024*1024),memkb*60/100/(1024*1024),swapkb*15/100/1024)} else {print $0}}' < $file"_bak" > $file
rm -f $file"_bak*"
systemctl daemon-reload
service urbackupclientbackend restart
uroni
January 14, 2023, 10:33am
#5
It shouldn’t use that much memory. If it does it would be helpful if you:
Either compile from sources or install debug symbols
Install heaptrack
and run with heaptrack /usr/local/sbin/urbackupclientbackend --config /etc/default/urbackupclient --no-consoletime
Send me the heaptrack result (that tells where in the program how much memory was allocated)