View Full Version : Using ionice to reduce disk I/O impact

Max Camber
January 19th, 2010, 07:27 PM
I have a fully working setup using Amanda 2.5.0p2 on my Red Hat 5 servers. What I am looking to do is use the ionice command to reduce the I/O impact when backing up servers that are in 24 x 7 production. It seems like this should be possible but I can't quite figure out where to stick ionice in the whole process.

The ionice command is much like regular nice, except that it deals specifically with disk I/O rather than CPU scheduling. It's settings are also is inherited by child processes so as long as I can get it in ahead of the tar and gzip portion of the backup it should work. I was hoping to use the script functionality but I'm not able to upgrade to version 2.6 due to business rules. Is there some other way I can easily sneak this into my backup process?

Just for testing purposes I manually set the ionice level of xinetd and it was automatically applied to amandad, tar, gzip, etc. but obviously that is not a long term solution as it affects all processes spawned by xinetd.

January 20th, 2010, 03:03 AM
I would change the xinetd configuration to run amandad with ionice:

server = /usr/bin/ionice
server_args = -c 2 -n 5 /path/to/amandad

Max Camber
January 20th, 2010, 07:39 AM
Sure enough, that works perfectly. I tried that exact setup with one critical mistake during my testing yesterday, I set the ionice level at -c3 instead of -c2. As the system I was testing on is always under load, the disk was never idle and so amandad didn't get started in time to respond to amcheck. It should have been obvious but I didn't even think to change the level until I read your post.

Thanks for the quick response martineau!

Max Camber
January 20th, 2010, 01:28 PM
Is there also an easy way to do this while connecting with SSH on the old version? It looks simple in the newer versions where you can just specify something like this in the amanda.conf file:

amandad_path "/usr/bin/ionice -c 2 -n 5 /var/lib64/amanda/amandad"

The top of the HowTo (http://wiki.zmanda.com/index.php/How_To:Set_up_transport_encryption_with_SSH) explains it like this:

/path/to/ssh -l <CLIENT_LOGIN> client.zmanda.com $libexecdir/amandad

Is there someplace I can set $libexecdir? If not, how does Amanda know where to look for amandad on various client architectures?

Note to other RHEL5 users stuck on 2.5.0p2, to get SSH working you need to add the root public key (/root/.ssh/id_rsa.pub) from your backup server to the amanda authorized keys file (/var/lib/amanda/.ssh/authorized_keys) on the client. (Red Hat Bugzilla entry (https://bugzilla.redhat.com/show_bug.cgi?id=510755))

January 20th, 2010, 02:35 PM
There is no way to do it.

Amanda use the same amandad path as it is on the server.

On the client, create a symlink from that path to the location of the amandad binary