summaryrefslogtreecommitdiff
path: root/disk-benchmark
blob: 5f9ab42c5d6e352395f54140f6838ace390eee25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

echo "WRITE SPEED"
for i in {0..2}; do
  A=$(dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc 2>&1 | tail -1 | cut -d " " -f 8-)
  echo $A
done
echo

echo "READ SPEED"
for i in {0..2}; do
  echo 3 > /proc/sys/vm/drop_caches
  A=$(dd if=tempfile of=/dev/null bs=1M count=1024 2>&1 | tail -1 | cut -d " " -f 8-)
  echo $A
done
echo

echo "BUFFERED READ SPEED"
for i in {0..2}; do
  A=$(dd if=tempfile of=/dev/null bs=1M count=1024 2>&1 | tail -1 | cut -d " " -f 8-)
  echo $A
done

rm tempfile