High CPU usage on FreeBSD 5.4 with nothing special running
*BSDThis forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
High CPU usage on FreeBSD 5.4 with nothing special running
This is a somewhat strange problem. It comes and goes. Basically what happens is that the CPU gets "pulsed". I don't know how else to describe it. I have wmmon running and about every 1 or 1.5 seconds the cpu usage gets a HUGE spike. So much so that it freezes the mouse cursor for about half a second. It doesn't always happen and installing something from ports usually sets it off (but not always). It doesn't just freeze the mouse cursor but pretty much everything. If I have music playing it stutters a bit, and typing from the keryboard gets affected too. It's not X because the problem started before I even installed X. In fact, it started almost immediately after I installed my system. I'm at a loss as to what's causing this.
I've searched the net and this site but to no avail. I'm not even sure if I'm searching for the right thing. I've searched for things like "high cpu usage", "cpu being pulsed", "jerky mouse/keyboard" and various others. No one out there seems to be having this problem. I've also checked the output of top but the most interesting thing I saw there was the CPU state of the system jumping between ~35% to ~55%. I haven't been able to attribute this to any particular process. I can post the output if anyone's interested. I've tried killing various processes including devd, moused and usbd. I also tried turning off soft updates but that didn't help and I suffered a large performance hit so I switched them back on.
So that's pretty much it. The system runs fine in (Debian) Linux and XP so I'm out of ideas. It is also worth noting that I had a simlar problem for a while in 5.2. It seemed to go away but then again I didn't use it much.
Update your system. X was using at least 30% cpu when idling for me. I updated 5.4release and now idling is 0.3% usage. My problem was a little different from yours though. Fresh install off cdrom of 5.4 worked fine. I was confused at the time with current vs. release so I updated to 6.0current which caused the high cpu usage, 5.4release solved the problem.
Check your cron jobs, by default freebsd performs some late night maintenance tasks but Ive forgotten what. I remember seeing routine disk activity at 3am and that is the info Ive found. Gonna look into it later..
Sorry if I was unclear but what I meant was the high cpu usage problem disappeared after I built and installed world/kernel, not X.
I was hoping to avoid rebuilding. It seems ridiculous to me also that the default kernel should be so unusable especially since rebuilding the kernel on BSD systems isn't looked apon with as much approval as it is in Linux. I'd much rather try and pinpoint a specific reason.
Upgrade still going. I'm not holdin out a lot of hope but it can't hurt to do.
Can you post your `top' output before and during one of these spikes?
// edited to add:
Re-building your kernel -- or userland -- is not a bad thing and may find on older systems you'll get better performance (especially if you use CPU-specific compile options). Give it a go.
The main differences I can see are that the top few processes alternate between states "RUN" and "select" and that the CPU system state alternates between ~35% and ~55%.
Re-building your kernel -- or userland -- is not a bad thing and may find on older systems you'll get better performance (especially if you use CPU-specific compile options). Give it a go.
This isn't a peice of crap computer. It's a P4 2.4GHz Intel with 1 GB of RAM. I'd expect even the most bloated system to run decently on this. Certainly not to be starved of CPU power. I may give the recompile a go but I'm a little busy this (and possibly next) week so it may be a while.
Looks like devd, but you said without that it still spikes. Odd.
Sorry I can't see how you're getting that. PID 666 was top. Admittedly I did cast a disapproving eye over devd when I saw that it was using ~13% CPU and it was the first thing I looked at killing.
I just realised I haven't been able to kill devd. I though I had previously. I'll look into disabling it.
Edit: I'm an idiot, I was sending the wrong signal. I managed to kill devd but spikes remain.
Edit: Further update. I've experimented with changing the devd settings but nothing so far. Killing devd doesn't help nor does not starting devd at all... BUT if I boot the system and there are no spikes (happens sometimes) and I install something from ports it's almost guaranteed to start the regular spikes. Also if I have top running the whole time I can see devd having initially inconsequential CPU usage. Once the spikes start, devd CPU usage slowly rises to around the 11% mark. In all situations killing devd does nothing. Could it be something calling devd? Something that happens independently of devd but when devd is running it responds to it?
I have the same problem, too. I just install FreeBSD 5.4 and have not installed other software yet.
The CPU usage of devd is high. But after I kill devd, the system is still very slow. I don't see any busy process in "top" but the "systat" show cpu is still in high usage.
the "systat -vm 1" shows :
Code:
4 users Load 3.25 4.84 3.93 Jun 23 14:34
Mem:KB REAL VIRTUAL VN PAGER SWAP PAGER
Tot Share Tot Share Free in out in out
Act 12460 1868 44012 1872 127208 count
All 120600 3628 2256436 3788 pages
Interrupts
Proc:r p d s w Csw Trp Sys Int Sof Flt cow 3925 total
1 28 14956 1 755011413 15 40884 wire 1: atkb
10832 act 6: fdc0
49.1%Sys 6.9%Intr 12.0%User 0.0%Nice 32.0%Idl 69180 inact 128 8: rtc
| | | | | | | | | | cache 3694 9: acpi
=========================+++>>>>>> 127208 free 13: npx
daefr 14: ata
Namei Name-cache Dir-cache prcfr 15: ata
Calls hits % hits % react 3 20: fxp
pdwak 100 0: clk
zfod pdpgs
Disks ad0 ofod intrn
KB/t 0.00 %slo-z 35248 buf
tps 0 tfree 3 dirtybuf
MB/s 0.00 17522 desiredvnodes
% busy 0 5249 numvnodes
25 freevnodes
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.