Any performance penalty from many (~10) snapshots?

This is for discussing general topics about how to use VirtualBox.
Post Reply
matteo
Posts: 6
Joined: 22. Jun 2013, 16:20
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Linux SLC Redhat Fedora

Any performance penalty from many (~10) snapshots?

Post by matteo »

Hi all,

should I expect any performance penalty from keeping many snapshots (let's say between 10 and 30) of my VM?

I use a linux (RHEL6.5) guest on a windows 7 (or 8.1 in my laptop) host and the virtual disks are the default dynamically growing disks (so the question is not between fixed size and dynamically growing disks, but rather between the latter with and without many snapshot)

I use to make snapshots before doing some update or other that I consider potentially prone to give problems and so far I have never deleted them, arriving to 14 snapshots.

What do you think about?

Thanks!
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Any performance penalty from many (~10) snapshots?

Post by loukingjr »

I can't see how it wouldn't cause some performance problem since the guest has to look through 14 files to run. Plus it's 14 more chances one could become corrupt. A better strategy would be to take one snapshot, do your update or change. Once you see you have no problem with the update or change, then delete the snapshot.

My two cents.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Any performance penalty from many (~10) snapshots?

Post by mpack »

Forget performance - IMHO 14 snapshots is a disaster waiting to happen. Sometime soon I would clone the VM (full clone, current state only, don't reset MAC) as cloning is the safest way to ditch the snapshots.

Might I recommend regular backups as being the simplest and most robust way of ensuring you can recover from problematic software installs. Sure, backups are a bit slower to create, but OTOH backups are sure to work.
peanut5654
Posts: 3
Joined: 8. Jul 2016, 14:46

Re: Any performance penalty from many (~10) snapshots?

Post by peanut5654 »

mpack wrote: Might I recommend regular backups as being the simplest and most robust way of ensuring you can recover from problematic software installs. Sure, backups are a bit slower to create, but OTOH backups are sure to work.
Backups are a valid point, but they are _significantly_ slower to create and the restoration is usually tedious as well.

My own example: I have a VM with 60GB virtual disk, which I use daily. I also do a daily block-level differential backup of the VDI using a software with an rsync-like algorithm. The software backs up only changed blocks which amount to ~300MB per day on the average. The problem is to scan the original and the back-up VDI in order to determine the delta. When doing this with the whole VDI (60GB), it takes around 20 minutes (I have an HDD) to scan for differences and back them up. 20 minutes of not being able to do anything else and waiting for the backup process to complete, because the VM can be started (resumed in my case) only afterwards of course.

Recently I found out that I can create 1 snapshot and let VirtualBox write all changes into it. It makes a huge difference time-wise whether I need to scan 60GB or a couple of GB for the differences. Yes, the snapshot will grow at around 300MB per day and after some time I'll need to merge it and create a fresh one, but it is still incomparable to backing up the whole VDI every day. For the snapshot the backup software needs 1 to 3 minutes.

Bottom line: this is the setup I will stick to for a while now. And it is good to know that the snapshot I/O performance is not an issue and makes this setup possible.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Any performance penalty from many (~10) snapshots?

Post by scottgus1 »

Backing up a live guest from the host using the take-snapshot-back-up-vdi-merge-snapshot-guest-is-unaware procedure is at least going to leave the backup in "crash-equivalent" circumstances, same as if the plug got pulled on the guest OS, and may leave one with an unrestorable backup. Also, trying to backup data that is changing at the same time leaves an uncontrollable situation. What data was backed up? All the housekeeping that a modern OS does when it is shutting down hasn't been done. Things like databases & such don't like this lack of housekeeping and fail violently at times if the OS can't shut down properly. That's why they make UPS's.

Backups that can't be restored aren't backups. Be sure whatever procedure used is able to be restored all the time, preferably to different hosts - best to be completely prepared.

If one wants to keep using the guest while the backup is taking place, then use in-the-guest backup software that does volume-shadow-copying or the Linux/Mac equivalent. One could also schedule the shut-down-guest-copy-the-files backup process while one is sleeping.
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all
Contact:

Re: Any performance penalty from many (~10) snapshots?

Post by michaln »

matteo wrote:should I expect any performance penalty from keeping many snapshots (let's say between 10 and 30) of my VM?
Yes, but it's impossible to predict how much. It depends on how "deep" in the snapshot chain VirtualBox has to go to access data. Also, the overhead of digging up the data may still be negligible compared to reading from a hard disk (and if you have an SSD it's probably going to be fast enough anyway).
Post Reply