1
edit
Changes
→Varinder Singh
Script in Python.Any suggestions would be welcome
=Kezhong Liang=
#!/bin/bash
echo "Start to test ..."
TIME_WRITE_START=$(date +%s)
dd if=/dev/zero of=test bs=1024 count=1000000
sync
TIME_WRITE_END=$(date +%s)
echo 3 > /proc/sys/vm/drop_caches
sync
TIME_READ_START=$(date +%s)
dd if=test of=/dev/null bs=1024 count=1000000
TIME_READ_END=$(date +%s)
rm test
echo "--------------------------------------------------------"
TIME_WRITE_USED=$(($TIME_WRITE_END - $TIME_WRITE_START))
echo -n "The write disk performance: "
echo -n $((1024 / $TIME_WRITE_USED))
echo " MB/sec"
TIME_READ_USED=$(($TIME_READ_END - $TIME_READ_START))
echo -n "The read disk performance: "
echo -n $((1024 / $TIME_READ_USED))
echo " MB/sec"