Linux – How to generate different levels of disk load on a Linux (2.4) system

benchmarkhard drivelinuxperformance

I need to find out about the impact different levels of disk I/O have on my application. To do so I am looking for a way to generate different amounts of disk load while I am running the application in a benchmark mode.

We currently get complaints from users about slow performance, however the information we get is very thin, so we cannot yet determine where exactly the problem is. I/O is the primary suspect, however we'd like to know for sure.

For starters I would be fine with something to create a configurable continuous read or write load, e. g. from /dev/zero to a tmp file or something. I know I can use dd, but this will push the disk to the limit immediately whereas I'd like some kind of throttle to make different test runs with increasing amounts of background traffic.

To make things a little more challenging, this has to run on RedHat9 boxes, which means kernel 2.4. So ideally this would be some kind of script that makes use of the default tools present anyway.

Best Answer

You could make a big file (eg 1GB) and then use rsync to copy the file. rsync has a built in option to limit the bandwith. So you could copy the file at 10KiB/sec, or 50KiB/sec or 2MiB/sec, etc.