Advertisement
phoenixdigital

Disk Performance

Jun 7th, 2022
1,038
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.70 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Ref: https://www.binarylane.com.au/support/solutions/articles/1000055889-how-to-benchmark-disk-i-o
  4.  
  5. ###########################
  6. # Only needed for testing. $SPLUNK_HOME should be present when this script is run by Splunk
  7. #
  8. SPLUNK_HOME="/opt/splunk"
  9. # SPLUNK_HOME="/opt/splunkforwarder"
  10. # pushd `dirname $0` > /dev/null
  11. # SCRIPT_PATH=`pwd -P`
  12. # echo $SCRIPT_PATH
  13. # WHITELIST_FILE="$SCRIPT_PATH/whitelist.txt"
  14.  
  15. ###########################
  16.  
  17. BASE_DIRECTORY="$SPLUNK_HOME/etc/apps/TA-splunk_performance_tests"
  18. TOTAL_TEST_FILE_SIZE="10G"
  19. NUM_FILES="50"
  20. NUM_JOBS="1"
  21. SPLUNK_INDEX_PATH="/opt/splunk/var/lib/splunk"
  22.  
  23. now="$(date +"%Y-%m-%d %H:%M:%S")"
  24.  
  25. # Random Read Writes (25% reads 75% writes)
  26. ${BASE_DIRECTORY}/bin/fio --runtime=60 --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=hotwarm_random_rw_25_75 --filename=${SPLUNK_INDEX_PATH}/fio-test.dat --bs=4k --iodepth=64 --size=${TOTAL_TEST_FILE_SIZE} --nrfiles=${NUM_FILES} --numjobs=${NUM_JOBS} --readwrite=randrw --rwmixread=25 --disable_lat=0 --disable_clat=0 --disable_slat=0 --output-format=json+
  27.  
  28. sleep 10
  29.  
  30. # Random Read Writes (25% reads-random 75% writes-sequential)
  31. ${BASE_DIRECTORY}/bin/fio --runtime=60 --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=hotwarm_random_rw_25_75__readrand_writeseq --filename=${SPLUNK_INDEX_PATH}/fio-test.dat --bs=4k --iodepth=64 --size=${TOTAL_TEST_FILE_SIZE} --nrfiles=${NUM_FILES} --numjobs=${NUM_JOBS} --readwrite=randrw --rwmixread=25 --disable_lat=0 --disable_clat=0 --disable_slat=0  --percentage_random=100,0 --output-format=json+
  32.  
  33. sleep 10
  34.  
  35. # Sequential Read Writes (25% reads 75% writes)
  36. ${BASE_DIRECTORY}/bin/fio --runtime=60  --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=hotwarm_seqential_rw_25_75 --filename=${SPLUNK_INDEX_PATH}/fio-test.dat --bs=4k --iodepth=64 --size=${TOTAL_TEST_FILE_SIZE} --nrfiles=${NUM_FILES} --numjobs=${NUM_JOBS} --readwrite=rw --rwmixread=25 --disable_lat=0 --disable_clat=0 --disable_slat=0 --output-format=json+
  37.  
  38. sleep 10
  39.  
  40. # Random Read Writes (75% reads 25% writes)
  41. ${BASE_DIRECTORY}/bin/fio --runtime=60 --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=hotwarm_random_rw_75_25 --filename=${SPLUNK_INDEX_PATH}/fio-test.dat --bs=4k --iodepth=64 --size=${TOTAL_TEST_FILE_SIZE} --nrfiles=${NUM_FILES} --numjobs=${NUM_JOBS} --readwrite=randrw --rwmixread=75 --disable_lat=0 --disable_clat=0 --disable_slat=0 --output-format=json+
  42.  
  43. sleep 10
  44.  
  45. # Sequential Read Writes (75% reads 25% writes)
  46. ${BASE_DIRECTORY}/bin/fio --runtime=60 --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=hotwarm_seqential_rw_75_25 --filename=${SPLUNK_INDEX_PATH}/fio-test.dat --bs=4k --iodepth=64 --size=${TOTAL_TEST_FILE_SIZE} --nrfiles=${NUM_FILES} --numjobs=${NUM_JOBS} --readwrite=rw --rwmixread=75 --disable_lat=0 --disable_clat=0 --disable_slat=0 --output-format=json+
  47.  
  48. sleep 10
  49.  
  50.  
  51. # Random Reads
  52. ${BASE_DIRECTORY}/bin/fio --runtime=60 --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=hotwarm_random_read --filename=${SPLUNK_INDEX_PATH}/fio-test.dat --bs=4k --iodepth=64 --size=${TOTAL_TEST_FILE_SIZE} --nrfiles=${NUM_FILES} --numjobs=${NUM_JOBS} --readwrite=randread --disable_lat=0 --disable_clat=0 --disable_slat=0 --output-format=json+
  53.  
  54. sleep 10
  55.  
  56. # Sequential Reads (Note last run contains unlink command to delete test file)
  57. ${BASE_DIRECTORY}/bin/fio --runtime=60 --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=hotwarm_sequential_read --filename=${SPLUNK_INDEX_PATH}/fio-test.dat --bs=4k --iodepth=64 --size=${TOTAL_TEST_FILE_SIZE} --nrfiles=${NUM_FILES} --numjobs=${NUM_JOBS} --readwrite=read --disable_lat=0 --disable_clat=0 --disable_slat=0 --unlink=1 --output-format=json+
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement