Oded Niv
Oded Niv

Reputation: 2737

How can I tell the raw size of a MySQL DB snapshots in Amazon RDS?

When I launch an Amazon MySQL database instance in RDS, I choose the amount of Allocated Storage for it.

When I create a snapshot (either manually or with the automatic backup), it says under "Storage" the same size as the size allocated for the instance, even though my database did not reach that size.

Since the pricing (or the free tier) in Amazon is dependent on the amount of storage used, I would like to know the real storage size I'm using, rather than the size allocated by the original database.

From looking at the Account Activity, and from knowing how mysqldump works, I would guess the snapshot does not really include the empty space allocated.

Upvotes: 17

Views: 9677

Answers (3)

bclarkreston
bclarkreston

Reputation: 637

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

The question asked is:

How can I tell the raw size of a MySQL DB snapshots in Amazon RDS?

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

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

As to the the original question, AFAICT, there is no API or console function to determine the storage used by an RDS snapshot. The DBSnapshot resource has allocated_storage (ruby, java), but this returns the storage maximum size requested when the database was created. This mirrors the AWS RDS console:

enter image description here

One might have thought this would be broken out on the AWS bill, but it provides very little details. For RDS:

enter image description here

The S3 part of the bill is even less helpful:

enter image description here

Conclusion, there is no way to tell the raw size of a MySQL DB snapshot in Amazon RDS.

Upvotes: 24

user3707125
user3707125

Reputation: 3484

RDS is being stored through EBS according to FAQ:

Amazon RDS uses EBS volumes for database and log storage.

EBS doesn't store empty blocks, according to its pricing page:

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

And takes space only for changed blocks after initial snapshot was made, according to details page:

If you have a device with 100 GB of data but only 5 GB has changed after your last snapshot, a subsequent snapshot consumes only 5 additional GB and you are billed only for the additional 5 GB of snapshot storage, even though both the earlier and later snapshots appear complete.

Upvotes: 9

ma.tome
ma.tome

Reputation: 276

RDS backups are block level full virtual machine snapshots; no mysqldump at all is involved. Given this fact, each of your snapshots will use exactly the same ammount of storage as your production instance at the moment the backup took place.

Upvotes: -1

Related Questions