http://www.ghidinelli.com/2009/05/26/estimating-io-requests-ec2-ebs-costs Are you thinking about moving to Amazon’s EC2 service? But you get to the part where you’re calculating how much your persistent (EBS) storage will cost and you have no idea? The Amazon pricing page looks like this: Amazon EBS Volumes
Well, I’d like to know how much it’s going to cost to run my database before I move it over and I can’t find squat on the Intarweb on how to estimate this cost. But assuming you’re running Linux, there is an easy way by looking at /proc/diskstats:
This is a device with hardware RAID so we want to ignore the individual partitions (c0d1p* for example) and look at the disks c0d0 and c0d1:
According to these directions on reading the numbers, you can add the first and fifth numbers of that row to get total reads and writes respectively since the system was started. To calculate your total I/O requests per month (what Amazon will charge you), just plug your numbers into this formula:
You can get this number another way by using iostat as well which will give you the average number of transactions per second since boot:
If you take the average TPS for your disks and multiply them out, you get roughly the same number (good enough to make a cost estimate for EC2):
You can see this particular box is under very light load with only 6,583,680 I/O requests per month. With EBS that would cost about $0.65. I think we can afford that. |