Computer slowdown when deleting snapshot

This is for discussing general topics about how to use VirtualBox.
Post Reply
vberic
Posts: 22
Joined: 27. Nov 2009, 18:00
Primary OS: openSUSE
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP SP3

Computer slowdown when deleting snapshot

Post by vberic »

I'm curious about this: I'm deleting snapshots. The "last" one (top of the tree) is taking about 10 minutes.
What's curious is this: as VB is removing a snapshot (doing it "merge" thing), my entire computer slows way, way down (Win7 64bit, 4GB RAM, Pentium Dual-Core CPU T4300 @ 2.10GHz each). Yet the Task Manager performance monitor only shows between 5 and 15% usage. That last fact doesn't seem to fit with the computer slowing down so much.

Does anyone know the explanation?
uli100
Posts: 59
Joined: 29. Oct 2009, 18:34
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Various Linux Distros
Location: Stuttgart, Germany

Re: Computer slowdown when deleting snapshot

Post by uli100 »

I guess the slow down is caused by disk io.

Best regards, Uli.
golimar
Posts: 9
Joined: 21. Dec 2010, 16:16
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: another XP, Linux, OS X

Re: Computer slowdown when deleting snapshot

Post by golimar »

It is definitely a I/O bottleneck. Optimizing this shouldn't be difficult. It looks like it has to read a lot of data and then write it again, both using the same disk. This could be done, for example:
- Instead of lots of smaller read and write operations, it should read a large amount of data into memory, then write it, then read again and so on (some users woudn't have much memory available so the size of this buffer could be a configurable option in Virtualbox)
- Using a different physical disk to store the temporary data and then writing it back to the primary disk (in case there is more than one physical disk in the computer)
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Computer slowdown when deleting snapshot

Post by noteirak »

Yes, merging snapshots is basically going full usage on the disk, using all the available IO. You are basically merging 2 files together, usually of several GB, so lots of read/write there...
golimar wrote:- Instead of lots of smaller read and write operations, it should read a large amount of data into memory, then write it, then read again and so on (some users woudn't have much memory available so the size of this buffer could be a configurable option in Virtualbox)
This won't do any good, the bottleneck is still the disk, you still have to read and write in sequence, and keep changing sectors on which you read and write. This is basically the worse you can do on a disk, perf wise.
Sadly, there isn't anything you can do on that bit.
golimar wrote:- Using a different physical disk to store the temporary data and then writing it back to the primary disk (in case there is more than one physical disk in the computer)
How could Virtualbox decide which disk is acceptable to use space? What about permissions? What about another application need the IOPS of that disk? Sounds very very unsafe to me.
That bit should be handled by the user/sysadmin IF you can actually make a case for using snapshots that would spawn over GBs in the first place...
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Computer slowdown when deleting snapshot

Post by mpack »

In any case this would be a non-issue for experienced users, who avoid the problem by avoiding snapshots.
golimar
Posts: 9
Joined: 21. Dec 2010, 16:16
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: another XP, Linux, OS X

Re: Computer slowdown when deleting snapshot

Post by golimar »

noteirak wrote:Yes, merging snapshots is basically going full usage on the disk, using all the available IO. You are basically merging 2 files together, usually of several GB, so lots of read/write there...
golimar wrote:- Instead of lots of smaller read and write operations, it should read a large amount of data into memory, then write it, then read again and so on (some users woudn't have much memory available so the size of this buffer could be a configurable option in Virtualbox)
This won't do any good, the bottleneck is still the disk, you still have to read and write in sequence, and keep changing sectors on which you read and write. This is basically the worse you can do on a disk, perf wise.
Sadly, there isn't anything you can do on that bit.
You have to change sectors much more if the disk head has to change too frequently from the place where it is reading, to the place where it is writing. The amount of data read and written will be the same, but in a less "fragmented" way. It's like doing few trips with a truck instead of a lot of trips with a car.
noteirak wrote:
golimar wrote:- Using a different physical disk to store the temporary data and then writing it back to the primary disk (in case there is more than one physical disk in the computer)
How could Virtualbox decide which disk is acceptable to use space? What about permissions? What about another application need the IOPS of that disk? Sounds very very unsafe to me.
That bit should be handled by the user/sysadmin IF you can actually make a case for using snapshots that would spawn over GBs in the first place...
True, the user should be the one choosing what disk to use for this. It's like when I'm uncompressing a big ZIP archive... I choose not to do it on the same place where the ZIP file lies, but instead I choose the other one for it
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Computer slowdown when deleting snapshot

Post by mpack »

Golden rule: don't give the user the rope to hang himself with, at least not unless there's a correspondingly huge upside.
golimar
Posts: 9
Joined: 21. Dec 2010, 16:16
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: another XP, Linux, OS X

Re: Computer slowdown when deleting snapshot

Post by golimar »

Sure :), this shouldn't be active by default in case it's implemented.
The upside is actually huge. It takes a lot of time, puts the disk in a lot of stress, the computer is almost unusable during this process, and probably creates fragmentation. Of course, this only applies in cases when creating and deleting snapshots can't be avoided.
Post Reply