This HTML automatically generated with rman for NEMO
Table of Contents


bigread - measure big buffered read speed of large files


bigread [parameter=value]


This program reads a file in fixed sized blocks, choosen by the user, and reports the average speed (MB/sec) for each block. This is purely based on the system cpu clock, not the user cpu clock (which is usually 0). The intent is to measure large blocked file I/O.

A curious statement about a QLC drive made me write this program: The read speed is about 2000MB/sec, but with a full cache, or after about 140GB, the read speed goes down to 185MB/sec. The truth is far more complex, but perhaps this program will come in handy one day.

You may thus find out that depending on the buffer size the read speed is fast in the beginning, but then later drops.


The following parameters are recognized in any order if the keyword is also given:
Input file [???]
Buffer size, in (1024 style) GB [1].
The cputime2(mode): 0:usr 1:sys (from times(2) or 2:clock from clock(2) . [1]


Here are a few examples how to create large (binary) files in NEMO, with size 2GB, 20GB and 200GB resp. Pick your poison:
    mkspiral s1 1000000 nmodel=40  
    mkspiral s2 1000000 nmodel=400 
    mkspiral s3 1000000 nmodel=4000
and to time them
    /usr/bin/time bigread s1 0.1
   0 602.353
   1 1706.67
   2 1706.67
   18 1280
   19 1024
   20 1470.61
   ### nemo Debug Info: End-time 1.73 sec
   Speed: n=21 min=602.353 max=1706.67 mean=1313.52 median=1280 rms=284.617
   0.00user 1.74system 0:02.17elapsed 80%CPU (0avgtext+0avgdata 107296maxresident)k
   4375016inputs+0outputs (0major+26364minor)pagefaults 0swaps
For benchmarking sometimes you want to make sure the I/O cache is empty. On linux the following command will do this: (as root)
     sync ; sync; sync; 
     sudo echo 1 > /proc/sys/vm/drop_caches
     sync ; sync; sync;


Benchmarking I/O operations on a linux (unix) system can be very tricky to understand. Here is an example of reading from a file vs. from a pipe:
    bigread s1 0.1
    cat s1 | bigread - 0.1

Obviously, making bufsize (which is in GB) too large, you can find out how well your swap performs.

For debug=1 the output also contains the timers(3NEMO) , which is much harder to interpret on a mult-tasking system.

See Also

dd(1) , clock(2) , iotop(1) , bonnie++(1) , iozone3(1) , cputime(3NEMO) , mkspiral(1NEMO)




Peter Teuben

Update History

11-Jul-20    V0.1 created    PJT

Table of Contents