VirtualBox

source: vbox/trunk/doc/manual/en_US/dita/topics/iocaching.dita@ 108643

Last change on this file since 108643 was 107390, checked in by vboxsync, 5 months ago

Docs: bugref:10705. bugref: 10829. The docs build has been modified to split generated refentry dita files and the user manual files and the following commits from doc's team git repo has been applied:

0946136c74dda0483704db891345cb39548b4e28 Started consolidating known issues and troubleshooting information
845b847e6a8e778b38a57867e25ee5e086a73800 Added individual topics for list of known issues, integrated into Troubleshooting section.
bb574836aac775889bd61e4a72f489617fcb7d18 Removed EFI firmware from experimental features for 7.2
6d2e68b244869991e713d170ecd239739d99ba56 Moved known issues into Known Issues section
e2630c896561587718b5c3197c384a38d07014d5 Merge branch 'VBP-1461_experimental-features' into 'main'
0512e2cce51f49ccdc56f3381a2a0c924f2bd278 Feedback on known issues
a77d6c980f6ff5cad9d32b2fb9290990093a03fa Restructured host and guest OS topics
988af5cc9628f5de0806531bc98686f691a911fd Updates with feedbback from Jacob
982a61c9f25b22b745ec483e763e3d88efe59c40 Included feedback from Jacob
93181c8c6cc2d9a26bcccb1145cb0423c0d9f4c9 Updated known issues with feedback from Klaus
8bc369561c383f09b409fe5e44f507440b3735fb Created Legacy Guest OS section
d7932f55accdab7a03666302d58b8c941cd48be2 Moved known issues to more appropriate places for the info
2a4aa094ba8a7ac6894d2a777316eabf41746580 Further moving of known issues
baeabd5308c5519a4dc26b4197be9b00e419a85a Updated links to cli_topics

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.1 KB
Line 
1<?xml version='1.0' encoding='UTF-8'?>
2<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
3<topic xml:lang="en-us" id="iocaching">
4 <title>Host Input/Output Caching</title>
5
6 <body>
7 <p><ph conkeyref="vbox-conkeyref-phrases/product-name"/> can optionally disable the I/O caching that the host OS
8 would otherwise perform on disk image files. </p>
9 <p>Traditionally, <ph conkeyref="vbox-conkeyref-phrases/product-name"/> has opened disk image files as normal files,
10 which results in them being cached by the host OS like any other file. The main advantage of this is speed: when
11 the guest OS writes to disk and the host OS cache uses delayed writing, the write operation can be reported as
12 completed to the guest OS quickly while the host OS can perform the operation asynchronously. Also, when you start
13 a VM a second time and have enough memory available for the OS to use for caching, large parts of the virtual disk
14 may be in system memory, and the VM can access the data much faster. </p>
15 <p>Note that this applies only to image files. Buffering does not occur for virtual disks residing on remote iSCSI
16 storage, which is the more common scenario in enterprise-class setups. See <xref
17 href="storage-iscsi.dita#storage-iscsi"/>. </p>
18 <p>While buffering is a useful default setting for virtualizing a few machines on a desktop computer, there are some
19 disadvantages to this approach: </p>
20 <ul>
21 <li>
22 <p>Delayed writing through the host OS cache is less secure. When the guest OS writes data, it considers the
23 data written even though it has not yet arrived on a physical disk. If for some reason the write does not
24 happen, such as power failure or host crash, the likelihood of data loss increases. </p>
25 </li>
26 <li>
27 <p>Disk image files tend to be very large. Caching them can therefore quickly use up the entire host OS cache.
28 Depending on the efficiency of the host OS caching, this may slow down the host immensely, especially if
29 several VMs run at the same time. For example, on Linux hosts, host caching may result in Linux delaying all
30 writes until the host cache is nearly full and then writing out all these changes at once, possibly stalling
31 VM execution for minutes. This can result in I/O errors in the guest as I/O requests time out there. </p>
32 </li>
33 <li>
34 <p>Physical memory is often wasted as guest OSes typically have their own I/O caches, which may result in the
35 data being cached twice, in both the guest and the host caches, for little effect. </p>
36 </li>
37 </ul>
38 <p>If you decide to disable host I/O caching for the above reasons, <ph
39 conkeyref="vbox-conkeyref-phrases/product-name"/> uses its own small cache to buffer writes, but no read caching
40 since this is typically already performed by the guest OS. In addition, <ph
41 conkeyref="vbox-conkeyref-phrases/product-name"/> fully supports asynchronous I/O for its virtual SATA, SCSI,
42 and SAS controllers through multiple I/O threads. </p>
43 <p>Since asynchronous I/O is not supported by IDE controllers, for performance reasons, you may want to leave host
44 caching enabled for your VM's virtual IDE controllers. </p>
45 <p>For this reason, <ph conkeyref="vbox-conkeyref-phrases/product-name"/> enables you to configure whether the host
46 I/O cache is used for each I/O controller separately. Either select the <b outputclass="bold">Use Host I/O
47 Cache</b> check box in the <b outputclass="bold">Storage</b> settings for a given virtual storage controller, or
48 use the following <userinput>VBoxManage</userinput> command to disable the host I/O cache for a virtual storage
49 controller: </p>
50 <pre xml:space="preserve">VBoxManage storagectl "VM name" --name &lt;controllername&gt; --hostiocache off</pre>
51 <p>See <xref href="../cli_topics/vboxmanage-storagectl.dita"/>.</p>
52 <p>For the above reasons, <ph conkeyref="vbox-conkeyref-phrases/product-name"/> uses SATA controllers by default for
53 new virtual machines. </p>
54 </body>
55
56</topic>
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette