New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLUSH CACHE I/O issue #565

Closed
zimbatm opened this Issue Nov 21, 2011 · 13 comments

Comments

Projects
None yet
4 participants
@zimbatm

zimbatm commented Nov 21, 2011

I know this is a Virtualbox issue but if we can find a work-around it would be nice.

The problem: when a lot of IO happens, like apt-get installs, the system slows down a lot. After a while, the linux guest machine starts to issue FLUSH CACHE kernel errors if you have the GUI. If you keep up, the linux guest re-mounts / as read-only. Then finally it crashes my OSX host machine. That makes Vagrant not really usable for Chef cookbooks testing.

By default Virtualbox doesn't forward the flush command to the OS. I suspect it causes write bursts which makes things really slow. It's actually possible to change that behavior ( http://www.virtualbox.org/manual/ch12.html -> "Responding to guest IDE/SATA flush requests" ) so I'm investigating to change that. Maybe pre-allocating the VM image would solve the issue as well.

@zimbatm

This comment has been minimized.

zimbatm commented Nov 21, 2011

Host info:

Darwin Guybrush.local 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug 9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64

  • full disk encryption

VirtualBox version: 4.1.6r74713

Guest: vagrant's lucid64 with the latest guest additions

@zimbatm

This comment has been minimized.

zimbatm commented Nov 21, 2011

Note that this issue is not new, it happend even before the oracle acquisiton

@zimbatm

This comment has been minimized.

zimbatm commented Nov 21, 2011

Ok, so enabling the flush sync seems to work.

VBoxManager list vms
# get the name of the box
VBoxManage setextradata "VM name" "VBoxInternal/Devices/ahci/0/LUN#[0]/Config/IgnoreFlush" 0
@zimbatm

This comment has been minimized.

zimbatm commented Nov 21, 2011

Actually it's still not working. I get errors like these:

[default] dpkg: unrecoverable fatal error, aborting:
 unable to fsync updated status of `libavahi-client3': Input/output error
[default] /tmp/vagrant-shell: line 48:  1041 Segmentation fault      apt-get install -qy $missing_debs
@mitchellh

This comment has been minimized.

Member

mitchellh commented Jan 12, 2012

Hm, I'm not sure if this is something that is safe to turn on all the time, but VirtualBox has a "host I/O cache" setting that some people need to enable to help with this. You can currently do it directly on the VM after it is created via the VirtualBox GUI or you can setup a config.vm.customize.

I'm not comfortable throwing this into Vagrant as a default since I'm not sure if it will break anything...

@robbles

This comment has been minimized.

robbles commented Jan 25, 2012

I'm having a similar problem - trying to use a simple shell provisioning script that installs several things using apt. It stops at the 4th package and completely freezes my OS X host system.

Can you provide a little more detail on how to customize the VM to turn this setting on automatically? I could turn it on through the VirtualBox GUI, but I want the whole setup to work from the first vagrant up.

@zimbatm

This comment has been minimized.

zimbatm commented Jan 25, 2012

Since I switched to a veewee-built oneiric64 from the stock lucid64 the problem seem to have disappeared

@mitchellh

This comment has been minimized.

Member

mitchellh commented Jan 29, 2012

Great!

In terms of enabling flushing from the Vagrantfile, I'd look at the VBoxManage command and see where you can switch it on. Until I can find a way to determine whether to enable this by default from Vagrant, I'm going to close this issue.

@mitchellh mitchellh closed this Jan 29, 2012

@robbles

This comment has been minimized.

robbles commented Mar 7, 2012

Has this been fixed in Vagrant 1.0?

I really want to use it for a project that requires automatic provisioning with Puppet, but I can't rely on it if it's going to freeze my host system.

@parisholley

This comment has been minimized.

parisholley commented Mar 10, 2012

I had this issue on my 2007 macbook pro, fixed by following these instructions:

http://joeshaw.org/2011/09/30/terrible-vagrant-virtualbox-performance-on-mac-os-x/

@robbles

This comment has been minimized.

robbles commented Mar 11, 2012

@parisholley great, thanks!

Looks like that fixed it permanently. I'm still curious about it not being a default though - what are the downsides to this setting?

@mitchellh

This comment has been minimized.

Member

mitchellh commented Mar 11, 2012

@robbles I'd love to make this the default! I simply need to find the setting to enable this from via VBoxManage, and then set it up to do so on vagrant up.

@robbles

This comment has been minimized.

robbles commented Mar 11, 2012

If you mean the command-line utility, using this seems to work:

VBoxManage storagectl <vm> --name <controllername> --hostiocache on

Where <controllername> seems to usually be something like "SATA Controller". Hope that helps. Haven't actually tested whether that's the right one, but it does change the setting according to the VirtualBox GUI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment