diff options
author | Rod Smith <rod.smith@canonical.com> | 2020-03-24 13:49:06 -0400 |
---|---|---|
committer | Rod Smith <rod.smith@canonical.com> | 2020-03-24 13:49:06 -0400 |
commit | b15f310c4985f240c499fce25ffb9a1275ff07ab (patch) | |
tree | 61041301dccdb2f65a1addf9993f15591f7350c5 /bin | |
parent | e3468f6ab82620b49ed2f5ffd4e700680a586e4d (diff) |
Update disk_read_performance_test with new device types & more modern minimum acceptable speeds
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/disk_read_performance_test | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/bin/disk_read_performance_test b/bin/disk_read_performance_test index 8d6d6a05..a98c1801 100755 --- a/bin/disk_read_performance_test +++ b/bin/disk_read_performance_test @@ -13,6 +13,10 @@ for disk in $@; do disk_type=`udevadm info --name /dev/$disk --query property | grep "ID_BUS" | awk '{gsub(/ID_BUS=/," ")}{printf $1}'` dev_path=`udevadm info --name /dev/$disk --query property | grep "DEVPATH" | awk '{gsub(/DEVPATH=/," ")}{printf $1}'` + # /sys/block/$disk/queue/rotational was added with Linux 2.6.29. If file is + # not present, test below will fail & disk will be considered an HDD, not + # an SSD. + rotational=`cat /sys/block/$disk/queue/rotational` if [[ $dev_path =~ dm ]]; then disk_type="devmapper" fi @@ -25,6 +29,12 @@ for disk in $@; do if [[ $dev_path =~ mmc ]]; then disk_type="mmc" fi + if [[ $dev_path =~ pmem ]]; then + disk_type="nvdimm" + fi + if [[ ($disk_type == "scsi" || $disk_type == "ata") && $rotational == 0 ]]; then + disk_type="ssd" + fi if [ -z "$disk_type" ]; then echo "ERROR: disk type not recognized" exit 1 @@ -48,8 +58,12 @@ for disk in $@; do "devmapper" ) MIN_BUF_READ=$DEFAULT_BUF_READ;; "ide" ) MIN_BUF_READ=40;; "mmc" ) MIN_BUF_READ=$DEFAULT_BUF_READ;; - "nvme" ) MIN_BUF_READ=200;; - "mdadm" ) MIN_BUF_READ=80;; + "nvme" ) MIN_BUF_READ=500;; + "nvdimm" ) MIN_BUF_READ=500;; + "mdadm" ) MIN_BUF_READ=150;; + "ata" ) MIN_BUF_READ=100;; + "scsi" ) MIN_BUF_READ=100;; + "ssd" ) MIN_BUF_READ=200;; * ) MIN_BUF_READ=$DEFAULT_BUF_READ;; esac echo "INFO: $disk_type: Using $MIN_BUF_READ MB/sec as the minimum throughput speed" |