| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 | .. _tuning:.. include:: global.rst.incTuning======General hints-------------CPU load, backup speed, memory and storage usage are covered below.As performance and resource usage depend on a lot of factors, you may need totweak the parameters a bit and retry until you found the best ones for yoursetup.Usually, the default parameters are selected for best speed under the assumptionthat you run a modern machine with fast CPU, fast I/O and a good amount of RAM.If you run an older or low-resource machine or your backup target or connectionto it is slow, tweaking parameters might give significant speedups.Exclude crap data-----------------Maybe you don't want to backup:* cache / temporary files (they can be rebuilt / are useless)* specific directories / filenames / file extensions you do not need* backups (some people make backups of backups...)You can exclude these, so they don't waste time and space.Avoid scrolling---------------If you do benchmarks, avoid creating a lot of log output, especially if itmeans scrolling text in a window on a graphical user interface.Rather use much less log output or at least redirect the output to a log file,that is also much faster than scrolling.Speed (in general)------------------Keep an eye on CPU and I/O bounds. Try to find the sweet spot in the middlewhere it is not too much I/O bound and not too much CPU bound.I/O bound~~~~~~~~~If CPU load does not sum up to 1 core fully loaded while backing up, theprocess is likely I/O bound (can't read or write data fast enough).Maybe you want to try higher compression then so it has less data to write.Or get faster I/O, if possible.CPU bound~~~~~~~~~If you have 1 core fully loaded most of the time, but your backup seems slow,the process is likely CPU bound (can't compute fast enough).Maybe you want to try lower compression then so it has less to compute.Using a faster MAC or cipher method might also be an option.Or get a faster CPU.I/O speed---------From fast to slower:* fast local filesystem, SSD or HDD, via PCIe, SATA, USB* ssh connection to a remote server's attic instance* mounted network filesystems of a remote serverNot only throughput influences timing, latency does also.Backup space needed-------------------If you always backup the same data mostly, you will often save a lot of spacedue to deduplication - this works independently from compression.To avoid running out of space, regularly prune your backup archives accordingto your needs. Backups of same machine which are close in time are usuallyvery cheap (because most data is same and deduplicated).Compression-----------If you have a fast backup source and destination and you are not low on backup space:Switch off compression, your backup will run faster and with less cpu load.If you just want to save a bit space, but stay relatively fast:Try zlib level 1.If you have very slow source or destination (e.g. a remote backup space via anetwork connection that is quite slower than your local and remote storage):Try a higher zlib or lzma.Authentication & MAC selection------------------------------Real MACs (Message Authentication Codes) can only be used when a secret key isavailable. It is signing your backup data and can detect malicious tampering.Without a key, a simple hash will be used (which helps to detect accidentaldata corruption, but can not detect malicious data tampering).Older or simple 32bit machine architecture~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Use sha256 (no key) or hmac-sha256 (key).64bit architecture, but no AES hardware acceleration in the CPU~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Use sha512-256 (no key) or hmac-sha512-256 (key).Modern 64bit CPU with AES hardware acceleration (AES-NI, PCLMULQDQ)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Use ghash (no key) or gmac (key).Encryption & Cipher selection-----------------------------Always encrypt your backups (and keep passphrase and key file [if any] safe).The cipher selection chooses between misc. AEAD ciphers (authenticatedencryption with associated data), it is EtM (encrypt-then-mac):Older or simple 32bit machine architecture~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Use aes256-ctr + hmac-sha256.64bit architecture, but no AES hardware acceleration in the CPU~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Use aes256-ctr + hmac-sha512-256.Modern 64bit CPU with AES hardware acceleration (AES-NI, PCLMULQDQ)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Use aes256-gcm (AEAD 1-pass cipher).RAM usage---------Depending on the amount of files and chunks in the repository, memory usagevaries:* about 250+B RAM per file (for "files" cache)* about 44B RAM per 64kiB chunk (for "chunks" cache)* about 40B RAM per 64kiB chunk (for repository index, if remote repo is used,  this will be allocated on remote side)If you run into memory usage issues, your options are:* get more RAM (or more swapspace, speed will be slower)* disable the "files" cache, speed will be slower* have less files / chunks per repoNote: RAM compression likely won't help as a lot of that data is usingmsgpack, which is already rather efficient.
 |