Skip to content

Instantly share code, notes, and snippets.

@theirishpenguin
Created November 11, 2012 11:10
Show Gist options
  • Save theirishpenguin/4054602 to your computer and use it in GitHub Desktop.
Save theirishpenguin/4054602 to your computer and use it in GitHub Desktop.
Simple benchmark for your SSD. Takes into account alignment of your disks
#!/bin/bash
# Based on the dd test script at https://wiki.archlinux.org/index.php/SSD_Benchmarking
# Disclaimer: Use at your own risk. This program comes with no warranty.
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2 # in order for the drop_caches command to work
exit 1
fi
for i in 1 2 3 4 5
do
echo "ITERATION $i"
echo "------------"
echo ""
echo 'WRITE SPEED'
dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc
echo 3 > /proc/sys/vm/drop_caches
echo ""
echo 'READ SPEED'
dd if=tempfile of=/dev/null bs=1M count=1024
echo ""
echo 'BUFFER CACHE READ SPEED'
dd if=tempfile of=/dev/null bs=1M count=1024
echo ""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment