Why VM snapshots are affecting performance?

46,613

Solution 1

When you create a snapshot, the original disk image is "frozen" in a consistent state, and all write accesses from then on will go to a new differential image. Even worse, as explained here and here, the differential image has the form of a change log, that records every change made to a file since the snapshot was taken. This means, that read accesses would have to read not only one file, but also all difference data (the original data plus every change made to the original data). The number increases even more when you cascade snapshots.

Solution 2

When you create a snapshot on a VM this creates a Delta Disk and the operating system writes to this file instead of the original VMDK. This file is called VM_Name-Delta.VMDK but if the system needs to refers to a file before the snapshot it will refers to VM_Name.VMDK increasing the I/O of this operation. If you take multiple snapshots you are referring to the last delta file of the last snapshot not the original VMDK thus increasing I/O.

Example.

OS ---> Snapshot (File A Created) ---> (Snapshot File B Created)

If I need to refer to File A it will be looking through 3 VMDK's to find this.

Also if you include the memory state of the VM at the time of snapshotting this creates a this again is a delta file and refers to the original memory files if needed.

A file is created this lists all the files created at the time of the snapshot process

Solution 3

As far as I can tell, VMWare is using copy-on-write logic to implement their snapshots. Therefore, when you create one, every operation done on your VM (eg. almost everything in runtime) would cause a little bit of the VM to be copied until the whole thing was essentially cloned.

Another performance issue with this is that reads would have to cascade to the original copy if the working copy doesn't yet have data (because nothing changed to cause a copy).

If you want to have the snapshots as a backup but can't tolerate a small performance decrease, consider cloning the VM instead.

Share:
46,613
Samselvaprabu
Author by

Samselvaprabu

I am mainly working as a Build and integrator. I am maintaining ESXi servers and doing little bit of Configuration management activities (Base Clearcase and clearcase UCM) as every build and integrator.

Updated on September 18, 2022

Comments

  • Samselvaprabu
    Samselvaprabu almost 2 years

    I read in one of the VMware KB articles that snapshots will directly affect VM performance.

    But my team keeps asking me how snapshots can affect performance.

    I would like to give them solid reason behind the statement the snapshots are performance killers.

    Can anyone explain a little bit theory about how snapshots are actually affecting the performance? Is it just because Disk I/O rate of hard disk would be slow?

    • Aaron Copley
      Aaron Copley almost 12 years
      Not sure if this is the KB article you read or not. I thought I would add it as reference.
  • Aaron Copley
    Aaron Copley almost 12 years
    Best explanation. You are not only doubling IOPS, but there is CPU overhead in calculating the block-level difference.
  • Max
    Max almost 12 years
    After reading this article linked by Aaron Copley (kb.vmware.com/selfservice/microsites/…) it seem worse than that. A Snapshot is not a differential image, it's a change log, so if you write the same data on the same place 10 times, the snapshot will increase it's size by 10 multiplied the size of data you wrote. Instead a differential image should be more efficient because it should overwrite the data rewritten at the same location.
  • Samselvaprabu
    Samselvaprabu over 11 years
    @Ansgar Wiechers: Did you read Max comments? He mentioned that as it is maintaining just change log it is worse than having different image. If that concept is more accurate. Please edit your answer. I felt your explanation is good and i would like to make it as answer.
  • Ansgar Wiechers
    Ansgar Wiechers over 11 years
    @Samselvaprabu Updated.
  • Ansgar Wiechers
    Ansgar Wiechers over 10 years
    @zespri The problem affects all virtualization platforms using this kind of snapshot technology, including Hyper-V.
  • Parthian Shot
    Parthian Shot over 8 years
    @AnsgarWiechers Just to clarify, though... VirtualBox uses a differencing image, right? I'm pretty sure it's not a changelog. Of course, if you're really worried, you always have the option of making a full clone in VirtualBox.
  • Daniel
    Daniel almost 7 years
    This is plain wrong. See @Falcon Momot's comment for the correct answer. Even the linked article just states the disk "can run out of space" which is clear when the space left before taking a snapshot is smaller than the snapshotted disk and the deltadisk does not have enought space to expand.
  • Ansgar Wiechers
    Ansgar Wiechers almost 7 years
    @Daniel Quoting from that very article: "The snapshot file is only a change log of the original virtual disk". Quoting from KB article 1015180 (added to the answer): "From the original parent disk, each child constitutes a redo log pointing back from the present state of the virtual disk, one step at a time, to the original". If you have other information contradicting VMware's knowledge base: please provide evidence.
  • Steve365
    Steve365 over 6 years
    @AnsgarWiechers This answer is definitely wrong. The linked article (kb.vmware.com/s/article/1015180) states; "The child disk, which is created with a snapshot, is a sparse disk. Sparse disks employ the copy-on-write (COW) mechanism, in which the virtual disk contains no data in places, until copied there by a write." Followed by; "If a virtual machine is running off of a snapshot, it is making changes to a child or sparse disk. The more write operations made to this disk, the larger it grows, to an upper limit of the size of the base disk plus a small amount of overhead."