Setting the OS X kernel asynchronous I/O limits to avoid VirtualBox crashing OS X

I had the need to setup a new VM for software testing today, and I kept running into intermittent problems where VirtualBox would freeze and then an OS X kernel panic, freezing/crashing the entire machine.

Luckily, I had made a snapshot in the OS moments earlier to the crash so I had a safe place to revert to, but the crashes kept happing at seemingly random times.

I setup a looped execution of 'dmesg' to see what was going on just before the crash and saw this at the next freeze:

VBoxDrv: host_vmxon  -> vmx_use_count=1 rc=0
VBoxDrv: host_vmxoff -> vmx_use_count=0
VBoxDrv: host_vmxon  -> vmx_use_count=1 rc=0
aio_queue_async_request(): too many in flight for proc: 16.
aio_queue_async_request(): too many in flight for proc: 16.
aio_queue_async_request(): too many in flight for proc: 16.
aio_queue_async_request(): too many in flight for proc: 16.
aio_queue_async_request(): too many in flight for proc: 16.
aio_queue_async_request(): too many in flight for proc: 16.

The first VBoxDrv messages didn't pull anything interesting in Google, but the other messages did: Virtual Box ticket #11219 and this blog post.

It would appear that the default limits for the OS X kernel's asynchronous I/O are very, very low. VirtualBox likely exceeds them when your VM(s) are performing heavy disk I/O, hence the 'too many in flight' message in the logs.

Luckily for us, there's a quick and easy solution:

sudo sysctl -w  kern.aiomax=512 kern.aioprocmax=128 kern.aiothreads=16

then restart VirtualBox. These settings will apply until you reboot. To make the changes permanent, add/update the following lines in /etc/sysctl.conf:
kern.aiomax=512
kern.aioprocmax=128
kern.aiothreads=16

Note: you can probably set those limits even higher, as documentation for Sybase (by SAP) recommends values 2048 / 1024 / 16 when using its software.

Rating: 

Comments

This is a test comment, please ignore.

Verifying if email notifications for comment replies is still working.

Indisputable online assignment helps is operate by proficient educational project writers. These writers make available obligation substance someone to do my assignment to student former to the target. The writers are responsive of the verity to submit a qualitative along with truthful obligation effort is ineffectual.

bash-3.2# cat /etc/sysctl.conf
kern.aiomax=2048
kern.aioprocmax=1024
kern.aiothreads=16
kern.sysv.shmall=1024
bash-3.2#
yours should be identical to mine

I am extremely new to this OS c kernel and very excited to learn a lot more about it. I feel sad for it's crashing when it's run. I have read from esasayontime that these os keeps on crashing but i have no idea what would have been the reason for it.

download free movies online from best movie sites
http://freemoviestreaming-sites.com/

I like your blog. You always give actual tips. Can`t wait new post from you.

I am tremendously novel to this OS c most important part and extremely keyed up to study a lot additional concerning it. I sense sad for it's deafening when it's sprint. I have understand writing from order coursework that these os keep on deafening but i have no thought what would have be the cause for it.

I have got the right way to get the pokemon go hack online for everyone to get pokecoins.

I loved your guide to the home media server with ZFS and I should tell you that it worked amazingly well for my gaming arena! I even asked management assignment writing help (link is external) to publish my work and the feedback I got was very positive. I am really thankful to you for sharing your research and hardwork with us!