high cpu usage on FreeBSD

So on FreeBSD with about 5-7 firefox tabs up, a youtube video playing, and a linux VM running, I see all my cpu cores at 35%, 50%, sometimes it even jumps up to 92%. On Windows with the same things running, (except using chrome instead of firefox) my cpu usage is very low, most of the time under 15%, 7%.... What's the reason for this? Does FreeBSD not have as good resource management vs Windows in general, or does it not manage resources for popular apps like virtualbox and firefox very well? I figured FreeBSD would perform better with less resources used, but it uses more of the CPU. I'm using btop++ to monitor.
 
what hardware resources have you made available to, applications and the FreeBSD kernel and applications
 
It depends on what the browser is doing. It's also possible FreeBSD IS doing resource management in the background. Stuff that Windows doesn't do and you have to do it on your own like disk defrag. But this is just grabbing at things in the air and, without studying it ourselves, there's no way of knowing what's happening on your system and especially whatever Windows is doing.
 
... I see all my cpu cores at 35%, 50%, sometimes it even jumps up to 92%. On Windows with the same things running, ... most of the time under 15%, 7% ...
Defining CPU states and measuring whether a CPU is idle is not trivial, and it wouldn't surprise me if different OSes define CPU usage differently. Although that should not lead to a factor of 3 or 4 between different measurements.

(except using chrome instead of firefox)
That could be the smoking gun: perhaps you are comparing apples and oranges.

5-7 firefox tabs up, a youtube video playing, and a linux VM running
Break the measurement down, and measure each application separately. Educated guess: The bulk of the difference comes from one of them. Probably either the browser that's used, or youtube video rendering.
 
… about 5-7 firefox tabs up, a youtube video playing, … I'm using btop++ …

Three Firefox windows, 888 tabs (not all loaded), numerous extensions, without playing a video, the hungriest process uses less than 6% of one of four CPUs (measured by htop):

1654999947897.png
 
I figured FreeBSD would perform better with less resources used, but it uses more of the CPU. I'm using btop++ to monitor.
Does the standard top tool agree with what btop++ is putting out?

It could be that Windows is misreporting things. Or it could be that Gtk / Qt is heavier than Win32 API for UI related things (which it is!).
 
… firefox …

about:config

Is fission.autostart true or false?

without playing a video, the hungriest process uses less than 6% of one of four CPUs …

I can easily trigger higher usage, by browsing sites that are sometimes (for me) relatively demanding:

1655051453597.png

… I have an Athlon 64 X2 dual core 6000+ CPU. …

Is this (also) the computer where you find high CPU usage?

Knowing more about the hardware, and software, will help. Can you share the result of a hardware probe?
  1. pkg install sysutils/hw-probe sysutils/pciutils sysutils/usbutils
  2. hw-probe -all -upload
Thanks
 
Does the standard top tool agree with what btop++ is putting out?

Yes, btop++ matches htop output. Well, +/- a few %. Good point about gtk/qt being heavier than win32 API.

Is fission.autostart true or false?

fission.autostart is false.

Yes, it's the same computer. Here is my HW probe:

https://bsd-hardware.info/?probe=bef9700756

Currently I have 10 firefox tabs up on websites with photo images and text, one tab is playing a YouTube music video with sound, one tab is Discord, 2 urxvt terminals loaded that are idle, btop++, htop, virtualbox with one Linux VM (1GB RAM allocated) loaded and idle, and CPU usage on each core is between 35%-41%.

I know that compiling a custom kernel will make my system boot a little faster (which I don't care about really), but will it actually increase performance / speed / loading of applications on the system itself? Other than process priority management through htop and building a custom kernel, is there any other ways to tune performance with regard to CPU / RAM ? (and possibly GPU?) Thank you.
 
I know that compiling a custom kernel will make my system boot a little faster (which I don't care about really), but will it actually increase performance / speed / loading of applications on the system itself?
No I don't think so. A more valid reason might be minimal disk space/embedded install or security reasons.
A good example is the floppy kernconf entry. 95% of users don't need this but what do you really save by removal?
You want faster application load speeds then buy a faster disk.
 
Yes, it's the same computer. Here is my HW probe:

https://bsd-hardware.info/?probe=bef9700756

Currently I have 10 firefox tabs up on websites with photo images and text, one tab is playing a YouTube music video with sound, one tab is Discord, 2 urxvt terminals loaded that are idle, btop++, htop, virtualbox with one Linux VM (1GB RAM allocated) loaded and idle, and CPU usage on each core is between 35%-41%
Given that it's a 2008 2-core 3GHz box, with roughly equivalent performance to an Intel 2.5GHz Core2Duo, viz:

https://www.cpubenchmark.net/cpu.php?cpu=AMD+Athlon+64+X2+Dual+Core+6000+&id=88

I think it's probably doing ok; a tad less loaded than I'd expect from my old Thinkpad X200 with 2.4GHz Core2Duo, with that much going on.

# systat -vm
might help with the overview .. works for me anyway.
 
Something else: is this with CPU running at full speed all the time, or are you running powerd(8)?

If the latter, you would expect to see CPU % usage higher, but of a lower base speed; monitor # sysctl dev.cpu.0.freq
 
Back
Top