Why is my incremental EBS snapshot taking the same time to create as a full EBS snapshot?

3 minute read
0

I want to know why creating an incremental snapshot of my Amazon Elastic Block Store (Amazon EBS) volume takes the same time to complete as a full snapshot.

Resolution

Snapshot creation time depends on the following factors:

  • The size of the EBS volume.
  • The amount of blocks changed (delta) since the last snapshot.
  • The workload on the EBS volume.
  • Active I/O to the EBS volume during snapshot creation. If I/O operations are concurring on the volume when the create call is issued, then the snapshot is de-prioritized.
  • Timing of the snapshot, because bandwidth is shared in the backend servers.
  • The time since the last snapshot taken.

By design, EBS snapshots show the full size of the backup instead of the incremental size. The first snapshot is the full copy of your data. Subsequent snapshots are incremental and contain the changed blocks from the most recent snapshot. The subsequent snapshot shows the full size because a new volume can be restored from any EBS snapshot, even though its incremental by design. Each incremental snapshot references the other snapshots in the backend.

For example, if all blocks are modified since the first snapshot, then creating a snapshot might seem to take as long as the full snapshot. This is because all of the blocks referencing the first snapshot are modified.

The greater the number of changes since the last snapshot, the longer subsequent snapshot creations takes.

Creation time also depends on other infrastructure factors, such as the load on the underlying storage subsystems. There is no way to predict how long EBS snapshots creation might take or to expedite this process.

For more information, see How snapshots work.

To check the actual size of a snapshot

1.    Run the list-snapshot-blocks AWS Command Line Interface (AWS CLI) command. In the following example command, replace value with your snapshot's ID.

$ aws ebs list-snapshot-blocks --snapshot-id value

Note: If you receive errors when running AWS CLI commands, make sure that you're using the most recent version of the AWS CLI.

The list-snapshot-blocks command lists all of the data blocks in that snapshot with the block indices and block tokens. Note that the API doesn't directly give you the total number of blocks. You must count the number of blocks returned based on either the block tokens or the block indices.

The list-snapshot-blocks command returns up to 10,000 blocks in a single result. If your snapshot has more than 10,000 blocks, then the command also returns a NextToken.

Run the following command to use the token to retrieve the next page of results. In the following example command, replace value with your snapshot's ID.

$ aws ebs list-snapshot-blocks --snapshot-id <value> --next-token value

2.    After counting the blocks, calculate the data size by multiplying the total number of blocks by 512 (each block is 512 KiB in size).

Example

Size of data in snapshot (in KiB) = Total number of blocks * 512

To reduce snapshot creation time

it's a best practice to take frequent snapshots of your volumes. Frequent snapshot creation means that the size of changed blocks on the volume is smaller, reducing the snapshot creation time. To automate snapshot creation and deletion, use Amazon Data Lifecycle Manager or AWS Backup.

Related information

Why is my Amazon Elastic Compute Cloud (Amazon EC2) AMI or EBS snapshot creation slow?

AWS OFFICIAL
AWS OFFICIALUpdated 10 months ago