How can I specify the size of the raw snapshots of a MySQL database in Amazon RDS?

When I run an instance of the Amazon MySQL database in RDS, I select the amount of storage allocated for it.

When I create a snapshot (manually or with automatic backup), it says in the Storage section the same size as the size allocated for the instance, although my database has not reached that size.

Since the price (or free tier) in Amazon depends on the amount of storage used, I would like to know the actual size of the storage that I use, and not the size allocated by the source database.

From a look at account activity and from knowing how mysqldump works, I would suggest that the snapshot does not include the allocated empty space.

+8
mysql amazon-web-services amazon-rds
source share
3 answers

RDS is stored through EBS according to the FAQ :

Amazon RDS uses EBS volumes to store databases and logs.

EBS does not save empty blocks according to its price page :

Since data is compressed before being saved to Amazon S3, and Amazon EBS does not save empty blocks, it is likely that the size of the snapshot will be significantly smaller than the size of your volume.

And it takes up space only for changed blocks after the initial picture was taken, according to the details page :

If you have a device with 100 GB of data, but only 5 GB has changed since the last snapshot, the subsequent snapshot consumes only 5 additional GBs, and you only pay for the additional 5 GB of snapshot storage, although both earlier and later snapshots are fully displayed .

+5
source share

I was interested in the answer to this question, and the Google search engine brought me here. I was surprised to see that, although there is an accepted, supported answer, it does not actually answer the question that was asked.

Asked question:

How can I specify the size of the raw snapshots of a MySQL database in Amazon RDS?

However, the accepted answer is actually the answer to this question:

I charge for the allocated size of the source database when I take an RDS snapshot from it.

Regarding the original question, AFAICT, there is no API or console function to determine the storage used by the RDS snapshot. The DBSnapshot resource has alloc_storage ( ruby , java ), but this returns the maximum storage size requested when creating the database. This reflects the AWS RDS console:

enter image description here

You would have thought that this would be broken down into the AWS account, but it contains very few details. For RDS:

enter image description here

The S3 account part is even less useful:

enter image description here

Conclusion, there is no way to talk about the raw size of a MySQL database snapshot in Amazon RDS.

+2
source share

RDS backups are snapshots of a full block-level virtual machine; no mysqldump is involved at all. Given this fact, each of your snapshots will use exactly the same amount of memory as your production instance at the time of the backup.

0
source share

All Articles