Skip to main content

Performance Tuning

By Scenario

ScenarioRecommended Flags
Local / LAN-av --whole-file
Remote (100 Mbps)-avz --compress-level=1
Slow link (< 10 Mbps)-avz --compress-level=6 --bwlimit=500 -P
Large files (DB dumps)-av --inplace
Logs / growing files-av --append
Many small files-av --no-compress --inplace
100K+ filesExclude junk + parallel jobs
Background jobnice -n 19 ionice -c2 rsync ...

Commands

# LAN: skip checksumming, copy whole files
rsync -av --whole-file src/ dest/

# Remote: light compression
rsync -avz --compress-level=1 src/ user@remote:dest/

# Large files in place (no temp file)
rsync -av --inplace /backup/db.sql.gz user@remote:dest/

# Append only (logs)
rsync -av --append /var/log/ user@backup:/logs/

# Parallel transfer (4 jobs)
find /src/ -maxdepth 1 -type d -print0 | \
xargs -0 -P4 -I{} rsync -av {} user@remote:/dest/

# Low priority (won't slow web server)
nice -n 19 ionice -c2 rsync -avz src/ user@remote:dest/

# Fast SSH cipher
rsync -avz -e "ssh -c aes128-gcm@openssh.com" src/ user@remote:dest/

# Exclude junk to speed up scanning
rsync -av --exclude='cache/' --exclude='node_modules/' \
--exclude='*.log' src/ dest/

# Benchmark
time rsync -avz --stats src/ user@remote:dest/
tip

Most speed gains come from excluding unnecessary files (cache, logs, node_modules) rather than tuning compression.