Thread: Measuring database IO for AWS RDS costings

Measuring database IO for AWS RDS costings

From
David Osborne
Date:

We have a test Postgresql AWS RDS instance running with a view to transferring our Live physical Postgresql workload to AWS.

Apart from the cost of the instance, AWS also bill for IO requests per month.

We are trying to work out how to estimate the IO costs our Live workload would attract.
So if we can confirm metrics x+y measured from within our test Postgresql instance on RDS maps to z billable IO requests, then we can measure the same metrics from our Live Postgresql server and estimate costs.

I believe in the AWS world an IO request is each 16kb read or written to disk.
How would I go about measuring 16kb blocks read or written to disk from within Postgresql?

I was hopeful of pg_stat_database which has blks_read (which I believe are 8kb blocks), but there doesn't seem to be an equivalent for blks_written?

Can anyone give us any pointers?

Regards,
--
David 

Re: Measuring database IO for AWS RDS costings

From
Guillaume Lelarge
Date:

Le 13 août 2014 15:47, "David Osborne" <david@qcode.co.uk> a écrit :
>
>
> We have a test Postgresql AWS RDS instance running with a view to transferring our Live physical Postgresql workload to AWS.
>
> Apart from the cost of the instance, AWS also bill for IO requests per month.
>
> We are trying to work out how to estimate the IO costs our Live workload would attract.
> So if we can confirm metrics x+y measured from within our test Postgresql instance on RDS maps to z billable IO requests, then we can measure the same metrics from our Live Postgresql server and estimate costs.
>
> I believe in the AWS world an IO request is each 16kb read or written to disk.
> How would I go about measuring 16kb blocks read or written to disk from within Postgresql?
>
> I was hopeful of pg_stat_database which has blks_read (which I believe are 8kb blocks), but there doesn't seem to be an equivalent for blks_written?
>

You're right that they are 8kB blocks (by default). But it's not read from disk, is more "postgresql asks the OS to give it the blocks". They may come from the disk, but they also may come from the OS disk cache. You can't find actual disk reads and writes from PostgreSQL.

Re: Measuring database IO for AWS RDS costings

From
David Osborne
Date:

You're right that they are 8kB blocks (by default). But it's not read from disk, is more "postgresql asks the OS to give it the blocks". They may come from the disk, but they also may come from the OS disk cache. You can't find actual disk reads and writes from PostgreSQL.

Thanks.
That makes it a bit tricky then.
So my best bet might be running iostat on the physical server and calculating Blk_read + Blk_wrtn for a period (4kb blocks in this case) and using that to estimate how many 16kb IO's that might translate to on AWS's RDS service for a month.


--
David