LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-13-2003, 04:04 PM   #1
pnh73
Member
 
Registered: Jul 2003
Location: Birmingham, UK
Distribution: Ubuntu,Debian
Posts: 381

Rep: Reputation: 30
Question Why am I getting ?high? CPU load?


Hi,

My server load sits constantly at ~3.0 and I am wondering if this is abnormally high for a fairly low traffic server running Apache 2.0.40, Postfix 1.12 with MailScanner, MySQL 3.23.58, SSH for SFTP transfers, SQUID 2.4 with DansGuardian and SAMBA 2.27 as a print server (last 3 only available on my LAN). These do not undergo a high usage. I am running RH8.0 and I am running web stats updates once an our which trawls through the web server logs for 3 sites and produces static pages via a perl script, this takes 6 minutes to complete for all three sites.

This is a typical uptime command output:

Code:
$ uptime
10:05pm  up 32 days, 23:53,  1 user,  load average: 4.00, 3.78, 3.48
Also could it be caused by the constant output of this error to screen?

Quote:
usb_control/bulk_msg: timeout
printer.c: usblp0: error -110 reading printer status
I know this was caused when i removed the usb printer cable from the computer, but how do i stop this error.

I have been scratching my head about the load issues and am unsure if this is abnormal or not.

TIA
 
Old 10-13-2003, 04:12 PM   #2
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
What does top show you as the most active process(es)? Remember that you load is a function of how active the CPU is and how long the waiting process list is. If you are running a lot of processes this will make you load higher as they're all waiting for the same cpu(s).

cheers

Jamie...
 
Old 10-13-2003, 04:45 PM   #3
pnh73
Member
 
Registered: Jul 2003
Location: Birmingham, UK
Distribution: Ubuntu,Debian
Posts: 381

Original Poster
Rep: Reputation: 30
Quote:
10:45pm up 33 days, 32 min, 1 user, load average: 3.00, 3.00, 3.07
89 processes: 81 sleeping, 2 running, 6 zombie, 0 stopped
CPU states: 7.9% user, 1.3% system, 0.0% nice, 90.6% idle
Mem: 126448K av, 122148K used, 4300K free, 0K shrd, 5792K buff
Swap: 257000K av, 91508K used, 165492K free 12640K cached
and here is a snapshot of the process list:

Quote:
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
594 postfix 18 0 0 0 0 Z 8.5 0.0 0:00 MailScanner <defunct>
584 admin 15 0 1096 1096 828 R 0.7 0.8 0:00 top
17930 squid 15 0 15020 2292 2140 R 0.1 1.8 1:11 squid
1 root 15 0 404 360 336 S 0.0 0.2 0:04 init
2 root 15 0 0 0 0 SW 0.0 0.0 0:00 keventd
3 root 15 0 0 0 0 SW 0.0 0.0 0:00 kapmd
4 root 34 19 0 0 0 SWN 0.0 0.0 0:00 ksoftirqd_CPU0
5 root 15 0 0 0 0 SW 0.0 0.0 1:16 kswapd
6 root 15 0 0 0 0 SW 0.0 0.0 0:00 bdflush
7 root 15 0 0 0 0 SW 0.0 0.0 0:00 kupdated
8 root 25 0 0 0 0 SW 0.0 0.0 0:00 mdrecoveryd
12 root 15 0 0 0 0 SW 0.0 0.0 0:13 kjournald
67 root 15 0 0 0 0 DW 0.0 0.0 0:00 khubd
160 root 15 0 0 0 0 SW 0.0 0.0 0:00 kjournald
162 root 15 0 0 0 0 SW 0.0 0.0 0:13 kjournald
163 root 15 0 0 0 0 SW 0.0 0.0 1:48 kjournald
25605 root 15 0 2768 540 512 S 0.0 0.4 1:44 cupsd
17727 root 24 0 460 324 324 S 0.0 0.2 0:00 sh
17728 root 25 0 2100 184 184 S 0.0 0.1 0:01 rpm
20647 root 15 0 616 320 320 S 0.0 0.2 0:00 dhclient
32736 root 15 0 0 0 0 SW 0.0 0.0 0:07 kjournald
12400 lp 15 0 572 396 396 D 0.0 0.3 0:00 lpd
12401 lp 15 0 0 0 0 Z 0.0 0.0 0:00 mf_wrapper <defunct>
12416 lp 15 0 2384 1212 1212 D 0.0 0.9 0:00 lpdomatic
28773 root 15 0 0 0 0 SW 0.0 0.0 0:00 eth0
28824 root 15 0 612 316 316 S 0.0 0.2 0:00 dhclient
28863 root 15 0 416 380 328 S 0.0 0.3 0:39 syslogd
28867 root 15 0 340 324 280 S 0.0 0.2 0:00 klogd
28884 rpc 15 0 360 288 288 S 0.0 0.2 0:00 portmap
28903 rpcuser 18 0 460 360 360 S 0.0 0.2 0:00 rpc.statd
28968 root 15 0 356 304 304 S 0.0 0.2 0:00 apmd
29005 root 15 0 640 496 464 S 0.0 0.3 0:08 sshd
CPU usage seems low. Just that there are a lot of processes
 
Old 10-13-2003, 07:21 PM   #4
jqcaducifer
Member
 
Registered: Jul 2003
Distribution: Fedora 3
Posts: 133

Rep: Reputation: 15
hm...
What's with the defunct mf_wrapper? not too sure what that is.
You have 2 dhclients running, don't know if this is necessary.
Why's there an rpm process?
And cups is usually for printers (i believe) if you killed your printer, you can disable this process.
 
Old 10-14-2003, 11:27 AM   #5
pnh73
Member
 
Registered: Jul 2003
Location: Birmingham, UK
Distribution: Ubuntu,Debian
Posts: 381

Original Poster
Rep: Reputation: 30
i have (had) two printers on the machine. One parallel one USB, now i have one Parallel. Can you give me some quick guidance about how to use kill?

TIA
 
Old 10-14-2003, 01:56 PM   #6
jqcaducifer
Member
 
Registered: Jul 2003
Distribution: Fedora 3
Posts: 133

Rep: Reputation: 15
There are definitely better more efficient ways, but to kill a process, i do
"ps -aux | grep <process>" where process is the name of the process...then see what the process ID is. Then
"kill <pid>", and do "ps -aux" again. If the process is still there and remains very stubborn, do
"kill -KILL <pid>"
that really kills them.
 
Old 10-15-2003, 11:28 AM   #7
pnh73
Member
 
Registered: Jul 2003
Location: Birmingham, UK
Distribution: Ubuntu,Debian
Posts: 381

Original Poster
Rep: Reputation: 30
wat are the more efficient ways?
 
Old 10-15-2003, 01:57 PM   #8
jqcaducifer
Member
 
Registered: Jul 2003
Distribution: Fedora 3
Posts: 133

Rep: Reputation: 15
Don't know. do "man kill" and "man grep" and "man ps" for more info. I know that there are many different ways to show only the pid of a process, and pipe that to kill, therefore only needing one command instead of 2 or 3, but the syntax is too complicated to remember, so I don't remember it.
 
Old 10-15-2003, 04:24 PM   #9
pnh73
Member
 
Registered: Jul 2003
Location: Birmingham, UK
Distribution: Ubuntu,Debian
Posts: 381

Original Poster
Rep: Reputation: 30
LOL, Cool, thanks for the help... going to murder some processes
 
Old 10-15-2003, 04:40 PM   #10
pnh73
Member
 
Registered: Jul 2003
Location: Birmingham, UK
Distribution: Ubuntu,Debian
Posts: 381

Original Poster
Rep: Reputation: 30
why why why isnt this working.. i do following:

Code:
[root@linux-hoster admin]# ps -aux | grep lpd
lp       12400  0.0  0.2  4692  364 ?        D    Sep25   0:00 lpd (Worker - Pri
lp         909  0.0  0.9  4668 1160 ?        S    22:31   0:00 lpd Waiting
root       928  0.0  0.4  3500  616 pts/0    S    22:32   0:00 grep lpd
[root@linux-hoster admin]# kill 12400
[root@linux-hoster admin]# ps -aux | grep lpd
lp       12400  0.0  0.2  4692  364 ?        D    Sep25   0:00 lpd (Worker - Pri
lp         909  0.0  0.9  4668 1160 ?        S    22:31   0:00 lpd Waiting
root       932  0.0  0.4  3500  616 pts/0    S    22:33   0:00 grep lpd
[root@linux-hoster admin]# kill -KILL 12400
[root@linux-hoster admin]# ps -aux | grep lpd
lp       12400  0.0  0.2  4692  364 ?        D    Sep25   0:00 lpd (Worker - Pri
lp         909  0.0  0.9  4668 1160 ?        S    22:31   0:00 lpd Waiting
root       935  0.0  0.4  3500  616 pts/0    S    22:33   0:00 grep lpd
Why isnt it working???

Would a 'soft' reboot help... do i do that by dropping to init 1 then back to init 3?

TIA
 
Old 10-15-2003, 05:56 PM   #11
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
Quote:
Originally posted by pnh73
wat are the more efficient ways?
Code:
killall lpd
would be pretty clean and tidy. If you didn't have kill all then...
Code:
kill `ps -ef | grep [l]pd | awk '{ print $2 }' | tr "\n" " "`
would work too - note that those are back ticks aroung ps -ef | grep [l]pd | awk '{ print $2 }' | tr "\n" " ".

In case you were wondering ps -ef | grep [l]pd | awk '{ print $2 }' show the process list (ps), grep's out lines that contain 'lpd' but does't match the grep process itself (otherwise you kill grep before you search has finished!), then uses awk to print out the second column of each line which is the process ID. The tr "\n" " " changes the newlines into spaces so you get a list that can be fed into the kill command; this last bit might not be strictly necessary I'm not 100% sure how kill will interpret new lines inbetween it's list of pids.

cheers

Jamie...
 
Old 10-16-2003, 10:47 AM   #12
pnh73
Member
 
Registered: Jul 2003
Location: Birmingham, UK
Distribution: Ubuntu,Debian
Posts: 381

Original Poster
Rep: Reputation: 30
even with that the process is being extremely stubborn and wont die! As i ask before, would a soft reboot do it? (init 1)
 
Old 10-21-2003, 02:38 AM   #13
tdemedts
LQ Newbie
 
Registered: Oct 2003
Distribution: SuSE 8.2
Posts: 9

Rep: Reputation: 0
I'm having a similar problem with acroread. From time to time, it somehow remains in the memory, and eats all the cpu time (99.9%). I just can't kill it. I thought it might have to do with other processes depending on it, but pstree shows that it's an independent process. I would be very glad if someone could tell me why this is happening, and how it can be solved... (By the way, I'm using an SMP kernel 2.4 on a P-IV with hyperthreading - I've no idea whether this could have something to do with it.)
 
Old 10-21-2003, 08:16 AM   #14
KingMoffa
LQ Newbie
 
Registered: Aug 2003
Distribution: RH
Posts: 7

Rep: Reputation: 0
try a kill with -9.

This sends it a much nastier death threat.
 
Old 10-21-2003, 08:21 AM   #15
tdemedts
LQ Newbie
 
Registered: Oct 2003
Distribution: SuSE 8.2
Posts: 9

Rep: Reputation: 0
Yes yes yes, tried all that. Doesn't work, not as regular user, and not as root. It's a -really- nasty process. (In case you're wondering, it's not a zombie process either, it's a real, running process.)
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
X Process: Occasional High CPU Load Fahrion Linux - Software 6 07-16-2005 06:47 PM
dm-crypt and high cpu load(pdflush) tazdevil77 Slackware 2 12-25-2004 02:03 PM
High load - but CPU 99% idle? Boss Hoss Linux - Hardware 6 05-24-2004 04:39 AM
High idle cpu load in 2.6.4? geekzen Linux - General 4 04-10-2004 11:54 AM
Help! very high CPU load by squid cash_05 Linux - Networking 0 10-08-2003 07:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:26 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