Performance Tuning for (cheap) Backups


Introduction

There are a variety of reasons to try to improve the speed of your backups:

This page is about performance tuning cheap/free software. You should probably try Storage Mountain or similar for info about performance tuning commercial software like Veritas NetBackup or Legato NetWorker.

Tunables

My current environment consists of a Linux server with a SCSI attached DLT 8000 drive (in an Adic FastStor 22 changer). Backup software is GNU tar and BRU. With this set of hardware and software, the following options are available for tuning:

Drive compression

Linux defaults to enabling drive compression. Drive compression can be disabled by running mt -f /dev/tape-device compression 0. See the mt(1) man page for more info.

st driver buffer

The st drive defaults to a 32k buffer. Presuming you are loading the st driver as a kernel module, you can adjust the buffer by adding a line to /etc/modules.conf like the following:

options st buffer_kbs=128
After making the change and making sure the module is reloaded (either by rebooting or by doing an rmmod/insmod), you should be able to run dmesg and see a line like the following with the increased bufsize:
st: Version 20010812, bufsize 131072, wrt 129024, max init. bufs 4, s/g segs 16
See drivers/scsi/README.st in the kernel source tree for more info.

Backup software buffer

GNU tar defaults to a 10k buffer. This can be increased via the -b command line option, which is in units of 512 bytes. I.e. specifying tar cbf 64 /dev/tape-device . tells tar to use a 32k buffer. See the tar(1) man page for more info.

The most recent version of BRU version 16 defaults to a 32k buffer. This can be adjusted in /etc/brutab.

Backup software compression

Neither GNU tar nor BRU defaults to using software compression. GNU tar can use gzip, bzip2 or any other compression program you want with the appropriate command line options. gzip is the most common and is enabled by adding the -z command line option. BRU software compression can be enabled with the -Z command line option.

Findings

I tested various settings for all of these options on a variety of different filesystems. What I found was the following:

Summary

The resulting set of options that resulting in the best performance with our setup was:

Unfortunately I was not able to make our DLT 8000 stream even with the best of all of these options enabled. (Tested by sticking my ear up next to the drive and listening. :) However, it did significantly improve backup performance over the default configuration.


Home
jheiss at aput.net
$Id: perftune_backups.shtml,v 1.2 2005/04/18 18:18:08 jheiss Exp $