Rsync Memory Usage – Optimize Performance

14.04memory usagersyncxubuntu

I am running on Xubuntu 14.04 and experiencing high memory usage of rsync.

With a fresh start, the system is OK.

I have rsync running in a cronjob, after/during rsync memory usage increases and stays high (seems like rsync is not freeing the memory).

Any hints/suggestions/etc???

rsync command:

sudo rsync -auAXv --delete --ignore-errors /* /media/edisz/backup_hdd/ --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}

Here's the htop output (after rsync):

screenshot of terminal showing htop

And free -m shows:

             total       used       free     shared    buffers     cached
Mem:          3816       3386        429         19        230       1000
-/+ buffers/cache:       2155       1660
Swap:         3954          0       3954

OK, firefox is eating ~400MB, but then there are still 1700MB left…

And before rsync:

screenshot of terminal showing htop output before rsync

             total       used       free     shared    buffers     cached
Mem:          3816       1497       2318         39         71        731
-/+ buffers/cache:        694       3121
Swap:         3954          0       3954

Best Answer

Dropping caches after rsync seem to fix the problem:

sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"

See also here.

Though, I do not find this very convenient....

Related Question