LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 06-12-2005, 12:59 AM   #1
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
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.

Thanks in advance.

Last edited by adz; 06-12-2005 at 01:02 AM.
 
Old 06-12-2005, 03:36 PM   #2
deviant03
LQ Newbie
 
Registered: Nov 2004
Location: New York City
Distribution: FreeBSD 5.4
Posts: 23

Rep: Reputation: 15
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.

Last edited by deviant03; 06-12-2005 at 04:56 PM.
 
Old 06-12-2005, 05:58 PM   #3
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Original Poster
Rep: Reputation: 53
But this was happening before I installed X. I thought it might have been some background fsck process but I couldn't find it in top.

I'll upgrade anyway (by that I assume you mean do a portupgrade -a) and see what happens.

Last edited by adz; 06-12-2005 at 08:50 PM.
 
Old 06-12-2005, 06:48 PM   #4
deviant03
LQ Newbie
 
Registered: Nov 2004
Location: New York City
Distribution: FreeBSD 5.4
Posts: 23

Rep: Reputation: 15
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.
 
Old 06-12-2005, 08:16 PM   #5
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Original Poster
Rep: Reputation: 53
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.

Last edited by adz; 06-12-2005 at 10:06 PM.
 
Old 06-14-2005, 08:06 PM   #6
RJW
Member
 
Registered: Nov 2003
Posts: 146

Rep: Reputation: Disabled
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.

Last edited by RJW; 06-14-2005 at 08:08 PM.
 
Old 06-14-2005, 08:41 PM   #7
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Original Poster
Rep: Reputation: 53
Here is top DURING a spike:
Code:
last pid:   666;  load averages:  5.44,  5.22,  3.08    up 0+00:10:21  11:40:51
41 processes:  4 running, 37 sleeping
CPU states:  7.2% user,  0.0% nice, 54.9% system, 10.2% interrupt, 27.6% idle
Mem: 44M Active, 31M Inact, 54M Wired, 676K Cache, 29M Buf, 856M Free
Swap: 512M Total, 512M Free

  PID USERNAME PRI NICE   SIZE    RES STATE    TIME   WCPU    CPU COMMAND
  303 root     119    0   516K   356K RUN       1:02 13.57% 13.57% devd
  593 root      96    0 85564K 84768K RUN      0:05  0.00%  0.00% Xorg
  624 adz       96    0 27796K 23932K select   0:03  0.00%  0.00% opera
  614 adz       96    0  7108K  5896K select   0:01  0.00%  0.00% fluxbox
  615 adz        8    0  2296K  1616K nanslp   0:01  0.00%  0.00% wmmon
  451 root      96    0  1240K   780K select   0:00  0.00%  0.00% moused
  619 adz       96    0  5860K  4964K RUN      0:00  0.00%  0.00% xterm-static
  620 adz       20    0  2336K  1872K pause    0:00  0.00%  0.00% tcsh
  419 root     119    0  1344K   996K select   0:00  0.00%  0.00% nfsd
  594 root       8    0  3392K  2768K wait     0:00  0.00%  0.00% xdm
  666 adz       96    0  2332K  1600K RUN      0:00  0.00%  0.00% top
  263 root      96    0  1772K  1320K select   0:00  0.00%  0.00% dhclient
  590 root      20    0  2968K  1824K pause    0:00  0.00%  0.00% xdm
  508 root      96    0  3476K  2656K select   0:00  0.00%  0.00% sendmail
  603 root     106    0  3332K  2664K select   0:00  0.00%  0.00% xconsole
  606 adz        8    0  1644K  1120K wait     0:00  0.00%  0.00% sh
  324 root      96    0  1324K   892K select   0:00  0.00%  0.00% syslogd
  341 root      96    0  1472K  1128K select   0:00  0.00%  0.00% rpcbind
  631 adz       96    0 27796K 23932K select   0:00  0.00%  0.00% opera
  411 root      96    0  1548K  1244K select   0:00  0.00%  0.00% amd
  530 root       8    0  1364K  1052K nanslp   0:00  0.00%  0.00% cron
  618 adz        8    0  1644K  1084K wait     0:00  0.00%  0.00% sh
  623 adz        8    0  1644K  1148K wait     0:00  0.00%  0.00% sh
  582 root       5    0  1288K   948K ttyin    0:00  0.00%  0.00% getty
  583 root       5    0  1288K   952K ttyin    0:00  0.00%  0.00% getty
  588 root       5    0  1288K   952K ttyin    0:00  0.00%  0.00% getty
  585 root       5    0  1288K   952K ttyin    0:00  0.00%  0.00% getty
  587 root       5    0  1288K   952K ttyin    0:00  0.00%  0.00% getty
  589 root       5    0  1288K   952K ttyin    0:00  0.00%  0.00% getty
  584 root       5    0  1288K   952K ttyin    0:00  0.00%  0.00% getty
  586 root       5    0  1288K   952K ttyin    0:00  0.00%  0.00% getty
  417 root     114    0  1388K  1024K select   0:00  0.00%  0.00% mountd
  512 smmsp     20    0  3356K  2696K pause    0:00  0.00%  0.00% sendmail
  502 root     119    0  3384K  2500K select   0:00  0.00%  0.00% sshd
  429 root      96    0   257M  1036K select   0:00  0.00%  0.00% rpc.statd
  453 root      96    0  1244K   804K select   0:00  0.00%  0.00% usbd
  421 root       4    0  1228K   804K -        0:00  0.00%  0.00% nfsd
  196 root      20    0  1192K   648K pause    0:00  0.00%  0.00% adjkerntz
  424 root       4    0  1228K   804K -        0:00  0.00%  0.00% nfsd
  422 root       4    0  1228K   804K -        0:00  0.00%  0.00% nfsd
  423 root       4    0  1228K   804K -        0:00  0.00%  0.00% nfsd
...and here is top in between spikes.
Code:
last pid:   684;  load averages:  8.20,  6.87,  4.49    up 0+00:15:23  11:45:53
41 processes:  1 running, 40 sleeping
CPU states: 15.6% user,  0.0% nice, 31.9% system,  8.9% interrupt, 43.6% idle
Mem: 49M Active, 31M Inact, 54M Wired, 676K Cache, 30M Buf, 851M Free
Swap: 512M Total, 512M Free

  PID USERNAME PRI NICE   SIZE    RES STATE    TIME   WCPU    CPU COMMAND
  303 root     132    0   516K   356K select   1:35 14.40% 14.40% devd
  593 root      97    0 85872K 85076K select   0:13  0.73%  0.73% Xorg
  624 adz       96    0 31812K 27972K select   0:07  0.00%  0.00% opera
  615 adz        8    0  2296K  1616K nanslp   0:01  0.00%  0.00% wmmon
  614 adz       96    0  7108K  5896K select   0:01  0.00%  0.00% fluxbox
  451 root      96    0  1240K   780K select   0:00  0.00%  0.00% moused
  619 adz       96    0  5860K  4964K select   0:00  0.00%  0.00% xterm-static
  620 adz       20    0  2336K  1872K pause    0:00  0.00%  0.00% tcsh
  419 root     119    0  1344K   996K select   0:00  0.00%  0.00% nfsd
  594 root       8    0  3392K  2768K wait     0:00  0.00%  0.00% xdm
  684 adz       96    0  2332K  1596K RUN      0:00  0.00%  0.00% top
  263 root      96    0  1772K  1320K select   0:00  0.00%  0.00% dhclient
  508 root      96    0  3476K  2656K select   0:00  0.00%  0.00% sendmail
  590 root      20    0  2968K  1824K pause    0:00  0.00%  0.00% xdm
  603 root     106    0  3332K  2664K select   0:00  0.00%  0.00% xconsole
  606 adz        8    0  1644K  1120K wait     0:00  0.00%  0.00% sh
  324 root      96    0  1324K   892K select   0:00  0.00%  0.00% syslogd
  341 root      96    0  1472K  1128K select   0:00  0.00%  0.00% rpcbind
  631 adz       96    0 31812K 27972K select   0:00  0.00%  0.00% opera
  530 root       8    0  1364K  1052K nanslp   0:00  0.00%  0.00% cron
  411 root      96    0  1548K  1244K select   0:00  0.00%  0.00% amd
  618 adz        8    0  1644K  1084K wait     0:00  0.00%  0.00% sh
  623 adz        8    0  1644K  1148K wait     0:00  0.00%  0.00% sh
  582 root       5    0  1288K   948K ttyin    0:00  0.00%  0.00% getty
  583 root       5    0  1288K   952K ttyin    0:00  0.00%  0.00% getty
  588 root       5    0  1288K   952K ttyin    0:00  0.00%  0.00% getty
  585 root       5    0  1288K   952K ttyin    0:00  0.00%  0.00% getty
  587 root       5    0  1288K   952K ttyin    0:00  0.00%  0.00% getty
  589 root       5    0  1288K   952K ttyin    0:00  0.00%  0.00% getty
  584 root       5    0  1288K   952K ttyin    0:00  0.00%  0.00% getty
  586 root       5    0  1288K   952K ttyin    0:00  0.00%  0.00% getty
  417 root     114    0  1388K  1024K select   0:00  0.00%  0.00% mountd
  512 smmsp     20    0  3356K  2696K pause    0:00  0.00%  0.00% sendmail
  502 root     119    0  3384K  2500K select   0:00  0.00%  0.00% sshd
  429 root      96    0   257M  1036K select   0:00  0.00%  0.00% rpc.statd
  453 root      96    0  1244K   804K select   0:00  0.00%  0.00% usbd
  421 root       4    0  1228K   804K -        0:00  0.00%  0.00% nfsd
  196 root      20    0  1192K   648K pause    0:00  0.00%  0.00% adjkerntz
  424 root       4    0  1228K   804K -        0:00  0.00%  0.00% nfsd
  422 root       4    0  1228K   804K -        0:00  0.00%  0.00% nfsd
  423 root       4    0  1228K   804K -        0:00  0.00%  0.00% nfsd
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%.

Last edited by adz; 06-14-2005 at 08:48 PM.
 
Old 06-14-2005, 08:49 PM   #8
RJW
Member
 
Registered: Nov 2003
Posts: 146

Rep: Reputation: Disabled
Hah:
Code:
last pid: 666;
Looks like devd, but you said without that it still spikes. Odd.

Bit busy right now... I'll get back to you.
 
Old 06-14-2005, 08:52 PM   #9
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Original Poster
Rep: Reputation: 53
Quote:
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.
 
Old 06-14-2005, 08:59 PM   #10
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Original Poster
Rep: Reputation: 53
Quote:
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?

Last edited by adz; 06-14-2005 at 11:47 PM.
 
Old 06-15-2005, 05:15 AM   #11
RJW
Member
 
Registered: Nov 2003
Posts: 146

Rep: Reputation: Disabled
Quote:
Originally posted by adz
Sorry I can't see how you're getting that. PID 666 was top. ...
I was referring to the last pid being `666' and your system doing `wierd things' on you.
 
Old 06-15-2005, 05:26 AM   #12
RJW
Member
 
Registered: Nov 2003
Posts: 146

Rep: Reputation: Disabled
I would definately say it's devd, or something relating to it, since devd running on my system uses low resources.

What modifications have you made to it?
 
Old 06-16-2005, 04:14 AM   #13
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Original Poster
Rep: Reputation: 53
I haven't made any. It did that pretty much from the get-go.
 
Old 06-16-2005, 05:53 AM   #14
RJW
Member
 
Registered: Nov 2003
Posts: 146

Rep: Reputation: Disabled
Have you tried pulling out/disabling all peripherals (i.e. network cards, sound devices, etc.)?
 
Old 06-23-2005, 01:37 AM   #15
alexwang
LQ Newbie
 
Registered: Jun 2005
Posts: 4

Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
High Cpu usage untak Debian 21 01-23-2007 06:21 AM
cpu usage high corbintechboy VectorLinux 2 07-27-2005 08:11 AM
CUPS and High CPU usage Malibyte Linux - Software 11 10-21-2004 09:56 AM
xine high CPU usage Phathead Slackware 1 07-14-2004 01:16 AM
locking at high CPU usage charon Linux - Newbie 4 03-10-2004 02:21 AM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 10:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration