Using VirtualBox, I've got a few Linux guests for different distros running on an Ubuntu host.

What filesystem layout will give the best performance?

Is it worth it to set up a different partition on the host just for the guests, with no journalling?

Or, conversely, should I disable journalling in the guests?

  • I'm also wondering if a filesystem like XFS, known for its superior management of large files, is better for hosting my virtual hard drives. – Evan Prodromou Mar 6 '11 at 19:50
  • One point worth mentioning is that for my use-case (testing software on multiple distros and OSes) the downside of using default file systems in the guest OS (possibly bad performance) is offset by the downside of using screwball, edge-case configurations on my test systems that don't reflect real customers' setups. – Evan Prodromou Mar 8 '11 at 15:51

The journalizing of filesystems typically only protect the metadata-portion of the filesystem. In the case of virtualization, the whole filesystem of the guest is considered data to the host OS. So in the case where you'd need journalizing, it doesn't help when either the host-filesystem itself or just the client FS gets corrupted.

Also, the overhead of journalizing is neglectable compared to the IO losses you have simple by virtualizing, which is magnitudes larger (if you get 50% of your original IO capacity to the guest, you are lucky, with plain VirtualBox, you probably get only ~30%). You shouldn't worry about the journal here. Thus my advice is: always use a journalizing filesystem.

Another point to mention is the time to restore in case of a crash. One of the most important tasks the journal fulfills is to ease recovery in case on an unclean shutdown. If you use a journalizing filesystem the time used be the mandatory fsck is going to be magnitudes smaller than on an unjournalized filesystem. This fact alone might be a deal-breaker if you need halfway decent restore times.

When you actually need IO, at least use a Type-1 Hypervisior (like Xen or KVM), which makes it easier to get to the 50% (or even a bit more) of remaining IO capacity, or use application-level virtualization like OpenVZ which only uses a minimal amount of resources itself.

|improve this answer|||||

Reiterating what's already been said here by others:

What filesystem layout will give the best performance? Ext4 currently performs near the top of the pack. No file system performs best in all cases. Some perform better for edge cases.

Is it worth it to set up a different partition on the host just for the guests, with no journaling? Journaling overhead is typically a negligible amount of overhead compared to other things that could be tuned, like the disk sub-system.

Or, conversely, should I disable journaling in the guests? No.

Do I need a journaling filesystem for both host and guest operating systems when using virtualization? Yes, because you want to test real world cases.

Increase the speed of disk I/O. When that become cost prohibitive then look at non-standard file systems.

  • Are you using raid on the host?
  • Do you have at least 4 drives in the raid set? (7200rpm sata 1gb = $60 - Total $240)
  • Do you have a multi-core CPU chip?
  • Do you have more than enough memory for all running virtuals plus 1gb for the host? I find less memory allocated to the virtual leaves more for a single host disk cache rather than two large caches. One in the virtual and the other on the host. This is faster in my setup. Reduce the memory allocated to each virtual. Make there is enough so you never swap.
  • Do you have a Nvidia Fermi ($60) or equiv performance level video card?
  • Do you have an SSD drive?
  • Directory depth should remain low.
  • Number of files in any directory should remain reasonably low.
  • Don't use swap, buy more memory.
  • Turn off services not needed both in host and virtuals.
  • Configure the virtual machines with only the hardware needed for each virtual.
  • Depending on the use cases, use a netbook or alternate pc for web surfing, music and video watching. Web browsers with flash are high CPU users.
|improve this answer|||||

depends on need. trade stability for speed. I/O overhead & hardware. usually journaling is worth it, can speed up access times in many situations.

|improve this answer|||||
  • This is for desktop virtualization -- testing out new software on different distros and OSes. It seems weird to me that it would make sense to do "double duty" journalling -- once in the guest OS, and again in the host OS. – Evan Prodromou Mar 6 '11 at 19:49

IMHO, it depends on how you plan on crashing your virtual machines (Ask yourself: Why do you need a journaling filesystem for in the first place?).

|improve this answer|||||

Journalling in the guest OS can give a false sense of security in case of an unclean shutdown of the host OS. For journalling to work, it is essential that the OS is in control of the order in which data is written to disk. The guest OS may think it is in control, but there is no guarantee that the host OS actually writes the data to disk in the same sequence. The result could be that upon reboot, the guest OS replays old journal data and overwrites more recent file data, possibly with unnoticed massive filesystem corruption as a result.

|improve this answer|||||

Without being totally sure, i think that the disk in a virtual is actually the RAM (afterall ... the virtual machine is an application -full virtualisation machines - )

What you may change is the type of journalling. writeback, ordered, journal journal : involves both data and metadata ordered : involves only metadata writeback : involves luck :p

|improve this answer|||||
  • Virtual disks are files on the host hard disk, not in RAM. Did I misunderstand your intent? – Wesley Mar 7 '11 at 3:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.