Page 1 of 1

[FreeBSD] high cpu load

Posted: 30. Aug 2016, 15:58
by virtualhuman
Hey there,

I've got a pfSense 2.3.2 64bit (FreeBSD) guest running on my Linux host (Fedora 23 64bit) and I've noticed a considerable amount of cpu usage on the host by the VirtualBox process.

Apparently, the VirtualBox process uses about 26-30% cpu, rather constantly. But if I ssh into the pfSense guest, cpu usage there is about 2-5%.

Interestingly, I run a lot of other virtual guests, running a range of operating systems (WinXP, Win7, Win10, Linux CentOS 6, Linux CentOS 7, and others, most are 64bit and two are 32bit) and they all run 2-5% cpu usage at idle. So pfSense is the only FreeBSD operating system that I have and it is the only one with high cpu usage problems.

Anyone knows what could be wrong? is there some incompatibility with FreeBSD?

Any help would be appreciated. Thank you!

Re: [FreeBSD] high cpu load *SOLVED*

Posted: 9. Nov 2016, 00:22
by virtualhuman
Mystery solved! Apparently there is some incompatibility between virtualbox and the way the freebsd kernel does interrupt polling.

The solution is to add the following line to the /boot/loader.conf

Code: Select all

kern.hz=100
Now cpu usage of the VM process is around 2% (when the freebsd guest is idle), instead of 26-30% cpu usage.

Re: [FreeBSD] high cpu load *SOLVED*

Posted: 2. Mar 2017, 08:32
by NothingCtrl
Thanks you!

Re: [FreeBSD] high cpu load

Posted: 7. Mar 2017, 17:20
by michaln
That's not "incompatibilty". That's the guest OS wasting CPU time by using an unreasonably high interrupt rate.

To give an analogy, if you check your watch 100 times an hour, you'll spend a lot more time doing it than when you check the watch 5 times an hour. That's just how it is, and if you consider the amount of time spent checking the time a problem, the only thing you can do about it is to check the watch less frequently.

Re: [FreeBSD] high cpu load

Posted: 19. Sep 2017, 02:47
by N0YB
Ran into high host CPU usage with a Linux or BSD guest a couple years ago. Turned out to be processor settings. Setting processors to number host has (2) and execution cap to 100% solve it in my case.