[FreeBSD] high cpu load

Discussions about using non Windows and Linux guests such as FreeBSD, DOS, OS/2, OpenBSD, etc.
Post Reply
virtualhuman
Posts: 53
Joined: 22. Jan 2013, 22:11

[FreeBSD] high cpu load

Post 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!
virtualhuman
Posts: 53
Joined: 22. Jan 2013, 22:11

Re: [FreeBSD] high cpu load *SOLVED*

Post 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.
NothingCtrl
Posts: 1
Joined: 2. Mar 2017, 08:29

Re: [FreeBSD] high cpu load *SOLVED*

Post by NothingCtrl »

Thanks you!
Last edited by socratis on 2. Mar 2017, 08:51, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all
Contact:

Re: [FreeBSD] high cpu load

Post 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.
N0YB
Posts: 36
Joined: 20. Sep 2012, 18:55

Re: [FreeBSD] high cpu load

Post 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.
Post Reply