-
Notifications
You must be signed in to change notification settings - Fork 76
Performance Tips
This page is dedicated to explain some of the burp configurations and system configurations that could be recommended to use in normal and large setups.
By default burp compresses a lot of files with zlib with compression factor '9'. Tunning exclude_comp
and/or compression
level can bring performance increase.
On Linux, it is recommended to use ext4 in your storage directory and of course a separated filesystem for your backup directory.
Use noatime
in your mount options in fstab
Example:
/dev/mapper/vg_storage-lv_storage /storage ext4 defaults,nobarrier,noatime 0 2
In this example I'm also use nobarrier
due to the fact I have a dedicated hardware RAID with battery, but it also could benefit your performance.
Disable the journal (be careful, only use it on a very safe device with UPS and stable IO):
tune2fs -O ^has_journal /dev/mapper/vg_storage-lv_storage
See more: https://wiki.archlinux.org/index.php/ext4 and https://cromwell-intl.com/open-source/performance-tuning/file-systems.html
burp with protocol 1 uses thousands of small (4k) files when working with librsync=1
in burp config. For this reason using other filesystems like xfs
or btrfs
could have slower performance in phase4
of burp backup and restore.
Also it is very recommended to create your filesystem in a dedicated filesystem for burp backups, and mount it on same place of you directory=[path]
.
It is recommended to use lvm, it will not have negative effect over performance and will allow you to dynamically modify the burp storage.
It is recommended to use directory=[path]
to another storage in clientconfdir client setup (per client) when you have very large clients, so you can allocate some secondary storage directory for some special clients.
If you are planning to use a NAS or any network filesystem, our recommendations is to not use CIFS or NFS share, those are too slow to provide good performance in reading and writing many small files (at least if you use librsync=1
it will read and write a lot).
Our recommendations are:
- Use iSCSI on a storage box, bonding/link aggreggation and multipath is recommended
- Format disk provided via iSCSI as ext4 (LVM is recommended!)
- Mount the filesystem on the disk provided via iSCSI with
noatime
mount option, change/etc/fstab
accordingly - use
manual_delete=[path]
- See section in burp settings below. - When connecting more than 1 NAS with iSCSI, use striped volumes to enhance the performance using them in parallel for I/O operations.
These are some of the burp settings you can use to improve the performance.
-
librsync=1
- It will send small files over network, improving speed when sending files, and uses less disk on each version, so it is recommended to have it enabled, but there is also some more things to know about it: It will slowdown performance inphase4
so it is very recommended to have small amount of children processesmax_children=2
when enabling librsync. Don't use librsync if you have a very fast network. -
manual_delete=[path]
- and set cron task to clean this path once a day at least. It will improve a lotphase4
when usinglibrsync
and when having slow disks, because will not delete old backup in this phase, instead it will move files to path -- IMPORTANT: To have the improvement, this path should be on same filesystem asdirectory
path. The cron task is automatically set when using ansible_burp2_server role, see: https://github.com/grke/burp/wiki/Automated-deploy-and-maintenance. -
hardlinked_archive=0
- In teory it should improve the speed if set to 1, but in practice it doesn't help too much if you are using librsync=1, read more details in http://burp.grke.org/docs/manpage.html. -
max_children=2
- Or 1 could be even better, do not backup too many clients at same time, it will always improve performance in many ways: RAM usage will be better use for disk cache when less processes are running for backups, disk IO will be better allocated, phase4 will take less time to finish when having less children running in phase4 at same time, network is better handled, and when using NAS it is highly recommended to have this set to 2 or less. -
protocol=1
- Use always protocol 1, it is the stable protocol at the moment. -
compression=5
- Use 5 or less for less CPU usage or test various compression factors to have less disk usage. -
exclude_comp
= - Add file extensions which should not be compressed
- Have at least 2 CPU cores. (1 per children)
- Have at least 8Gb of RAM in server (4 Gb of RAM per "children"), more if you need to backup large files (burp itself uses only few Mb, something between 20 and 50Mb depending on max_children settings, but for disk CACHE when using librsync=1 is recommended to have more RAM because burp will read and write thousand of small files, and if you are using NAS it is recommended to have more either to allocate more in cache and speed up more phase4). In very large deployments with something around 2Tb or more in storage, add more RAM like 8GB or 16Gb per "children" to allow the filesystem use more cache.
When compiling burp, you can optimize it for your actual processor architecture, and add a certain degree of parallelism that will give a little performance improvement (expect 5%). Add the following CFLAGS to your configure statement
CFLAGS="-O2 -march=native -mtune=native -mfpmath=sse -floop-parallelize-all -ftree-parallelize-loops=4" ./configure
Be aware that using -march and -mtune will make your compiled burp work only with the actual processor you compiled with. Omit those parameters if you want to compile for other cpus.
When running burp on a virtual machine, you may disable ethernet offloading to improve network performance, since the actual offloading will be handled by the cpu anyway.
On RHEL / CentOS, you may use the following:
ethtool --offload eth1 tso off gso off rx off tx off sg off gro off
Some of these tips was discussed during the implementation of https://github.com/CoffeeITWorks/ansible_burp2_server/issues/15
Use Striped volumes on LVM2, so you can benefit on increased performance: see https://sysadmincasts.com/episodes/27-lvm-linear-vs-striped-logical-volumes
Pablo Estigarribia - pablodav at gmail