Skip to content
amitbalode edited this page Jun 5, 2016 · 6 revisions

#GenerateDiskLoad# GenerateDiskLoad is used to simulate disk load.

 Ex, java GenerateDiskLoad; GenerateDiskLoad command also take custom parameters.
  speedInMBPerSec is used to specify speed of disk write.
  fileSizeInMB is used to specify size of the file being written to disk.
  iterations is used to loop through file creation multiple times.
 Ex, java GenerateDiskLoad --speedInMBPerSec=100 --fileSizeInMB=1000 --iterations=2

##Output##

[machine1 ~/perf : ~]$java GenerateDiskLoad --fileSizeInMB=1000
Printing command line arguments or their default values: {fileSizeInMB=1000, speedInMBPerSec=100, iterations=1}
Total data written to file: 0
Total data written to file: 93 MB
Total data written to file: 190.4 MB
Total data written to file: 289.8 MB
Total data written to file: 389.3 MB
Total data written to file: 488.8 MB
Total data written to file: 588.1 MB
Total data written to file: 687.4 MB
Total data written to file: 788.3 MB
Total data written to file: 888.5 MB
Total data written to file: 938.5 MB
Total data written to file: 976.8 MB
Total data written to file: 976.8 MB
Iteration 0 Took 12.945 seconds to write to a 1000 MB, file rate: 81.0 MB/s

###Additional monitoring### While GenerateDiskLoad command is running you can open another terminal and watch for page cache behaviour

[machine1 ~ : ~]$while true; do sleep 1; cat /proc/vmstat | grep -w 'nr_dirty\|nr_writeback' | xargs echo ;done
nr_dirty 79160 nr_writeback 0
nr_dirty 104946 nr_writeback 0
nr_dirty 130690 nr_writeback 0
nr_dirty 156449 nr_writeback 0
nr_dirty 164992 nr_writeback 15035
nr_dirty 183933 nr_writeback 553
nr_dirty 207834 nr_writeback 606
nr_dirty 229338 nr_writeback 434
nr_dirty 170071 nr_writeback 23476
nr_dirty 120919 nr_writeback 25011
nr_dirty 75863 nr_writeback 24081
nr_dirty 30807 nr_writeback 22799
[machine1 ~ : ~]$dstat
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw
  3   2  96   0   0   0|   0    48k| 198B  646B|   0     0 |1429  2083
  3   2  96   0   0   0|   0     0 | 330B 1142B|   0     0 |1600  2313
  3   2  89   7   0   0|   0   106M| 198B  646B|   0     0 |1821  2233
  2   2  87   9   0   0|   0   113M| 330B  646B|   0     0 |1667  1952
  2   1  88   9   0   0|   0   111M|1032B 3054B|   0     0 |1595  2041
  2   2  83  13   0   0|   0    83M| 462B  938B|   0     0 |1836    13k
  0   1  87  12   0   0|   0   155M| 198B  662B|   0     0 | 928    58k
  0   1  90   9   0   0|   0   186M| 264B  500B|   0     0 | 931    46k
  0   2  88  10   0   0|   0   176M| 132B  500B|   0     0 |1042    13k
  0   1  95   4   0   0|   0    70M| 264B  484B|   0     0 |1276  4361
  0   0 100   0   0   0|   0     0 | 192B  484B|   0     0 | 453   649

Clone this wiki locally