1

I was just building a vagrant environment with the box debian/stretch64. This is a test bed for ruby chef, so first thing my provisioner does is this:

apt-get install -y curl
curl -L https://omnitruck.chef.io/install.sh | bash -s -- -v 13.7.16

However, that takes minutes to finish. Specifically the install chews a lot on dpkg's "Unpacking ..." instances. I figured it might be a disk issue and I found the "Use Host I/O Cache" setting for the VirtualBox SATA controller. It was switched on so I switched it off and tried again ... tada, the same two commands from above run through in about 10 seconds.

So my question is primarily, how I can get a better view of the host I/O cache. What linux tools are available to inspect and configure it? I have read https://www.virtualbox.org/manual/ch05.html#iocaching and I would like to verify whether I'm affected by one of the disadvantages mentioned there.

Also, I would very much like to hear your interpretation of why deactivating the cache should lead to a performance increase. I am using a workstation with arch linux, 16GB of RAM (htop shows 5.17G/15.6G used while the 1G vm is running) and an i5 7500 3.4 GHz. Let me know if I can provide more details.

UPDATE: I didn't measure it but also with the box debian/jessie64, dpkg takes very long to decompress packages when the host I/O cache is on.

Thanks!

1
  • This makes me wonder if there is some (unwanted) interaction between sync/fsync and the host I/O cache, because apt/dpkg are known to use sync/fsync excessively. I would experiment with package eatmydata with and without host I/O cache.
    – Gregor
    Dec 19, 2018 at 18:59

1 Answer 1

2

This is a bug in VirtualBox 5.2.x - it appearently leads to continuous syncs when the cache is turned on. According to the linked ticket, it is fixed in VirtualBox 5.2.19.

1
  • 1
    Thanks! I couldn't reproduce it anymore recently, but I'm on v6 for quite a while now.
    – moritz
    Apr 21, 2020 at 19:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .