Pages

Monday, April 8, 2013

Part 8: Performance Tuning Amazon Elastic Block Store - Pre Warming the EBS volume


New EBS Volumes always experience a “First Use Penalty” in AWS; means there will be a performance hit on the first write to an unused block on the EBS Volume and will perform slower than subsequent writes. During this time you can experience spike in volume metrics like service times, I/O latency and then subsequently leading to normalization. It is observed that 5 to 50 percent reduction in IOPS when you first access the data on a volume. Performance is restored after the data is accessed once. Therefore, it is recommended that you read or write to all the blocks on your volume before you use it.
$ dd if=/dev/md0 of=/dev/null
In Linux, the above command reads from all blocks on a volume and pre-warms the volume. On Windows, formatting the new EBS volume pre-warms it.
“dd” is not verbose by default so download and use the following script from the github, it shows the status of the pre warming of EBS Volumes, URL:  https://gist.github.com/muhqu/3293988

#!/bin/bash
if [ -z "$1" ];
  echo "Usage: sudo $0 /dev/sdh1"
  exit 1;
fi
 dd if=$1 of=/dev/null & pid=$!
while true; do
  ps -p$pid --no-heading || break;
  echo "-- $(date) ------------------";
  kill -USR1 $pid;
  sleep 60s;
done
echo "-- $(date) ------------------";
echo "DONE \o/"


No comments:

Post a Comment