LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 02-05-2005, 12:31 AM   #1
naijaguy
Member
 
Registered: Aug 2004
Posts: 88

Rep: Reputation: 15
how to check cpu level?


What's a command for checking the CPU level in Linux? (Running Red Hat 8)

I'm just looking for something like the Windows Task Manager's Performance tab...like a percentage or something. Thanks...
 
Old 02-05-2005, 12:32 AM   #2
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
top
 
Old 02-05-2005, 01:07 AM   #3
hendrixbart
LQ Newbie
 
Registered: Sep 2003
Location: Brunssum
Distribution: Debian own distribution
Posts: 18

Rep: Reputation: 0
You can use the command top.

This will give you output like the following:
7:07am up 4 days, 16:28, 1 user, load average: 0.08, 0.10, 0.09
101 processes: 99 sleeping, 2 running, 0 zombie, 0 stopped
CPU states: 8.7% user, 7.1% system, 0.0% nice, 9.8% idle
Mem: 257392K av, 243352K used, 14040K free, 127108K shrd, 125648K buff
Swap: 208836K av, 4K used, 208832K free 20812K cached

PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND
9283 root 18 0 1284 1284 716 R 0 10.1 0.4 0:00 top
9284 root 18 0 1096 1092 612 R 0 10.1 0.4 0:00 ps
1 root 0 0 480 480 412 S 0 0.0 0.1 0:07 init
2 root 0 0 0 0 0 SW 0 0.0 0.0 0:00 kflushd
3 root 0 0 0 0 0 SW 0 0.0 0.0 0:41 kupdate
4 root 0 0 0 0 0 SW 0 0.0 0.0 0:00 kpiod
5 root 0 0 0 0 0 SW 0 0.0 0.0 0:00 kswapd
6 root 0 0 0 0 0 SW 0 0.0 0.0 0:00 md_thread
188 root 0 0 548 548 476 S 0 0.0 0.2 0:00 pptpd
235 daemon 0 0 384 384 308 S 0 0.0 0.1 0:00 portmap
304 root 0 0 584 584 480 S 0 0.0 0.2 10:03 syslogd
306 root 0 0 804 804 404 S 0 0.0 0.3 0:12 klogd
310 root 4 0 1488 1488 892 S 0 0.0 0.5 12:19 easyWatchdog
328 root 0 0 276 276 220 S 0 0.0 0.1 0:00 pwcheck
332 root 0 0 11812 11M 832 S 0 0.0 4.5 0:04 named
342 root 0 0 1400 1400 876 S 0 0.0 0.5 0:00 ea

Keep in mind that the loadaverage is above 2, your system is working very hard ;-)
 
Old 02-05-2005, 06:49 AM   #4
LasseW
Member
 
Registered: Oct 2004
Distribution: Fedora 7, OpenSuse 10.2
Posts: 108

Rep: Reputation: 15
KDE has ksysguard with output very similar to the Performance and Processes tabs in Windows Task Manager. Not sure if you have it on RH8, though.
 
Old 02-05-2005, 12:48 PM   #5
naijaguy
Member
 
Registered: Aug 2004
Posts: 88

Original Poster
Rep: Reputation: 15
I have two servers. One is running a web app on Tomcat, and the other is running my little custom load testing threads against that web app. The Tomcat machine says something like 92% idle and the load average is a low fraction. But the tester server has this:

load average: 19.88, 23.52, 11.12

Is that pretty intense?
 
Old 02-05-2005, 12:53 PM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 3,988

Rep: Reputation: 261Reputation: 261Reputation: 261
That's not intense if you're running a 24 processor SMP machine . Assuming you're not, though, it looks like the machine is quite stressed. You should use top to see what's hogging the CPU. You might also get a situation like this if you have a bunch of processes in an uninterruptable sleep waiting for I/O. This can happen if, for example, you're usinf NFS and your NFS server goes down, leaving processes accessing data on it in a limbo.
 
Old 02-05-2005, 01:00 PM   #7
naijaguy
Member
 
Registered: Aug 2004
Posts: 88

Original Poster
Rep: Reputation: 15
Just 2 processors! I had a simple Java program spawn about 500 separate threads to attack our webserver.

When you see the list of processes when running top, how do you scroll down to see the rest?
 
Old 02-05-2005, 02:20 PM   #8
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 3,988

Rep: Reputation: 261Reputation: 261Reputation: 261
Well, that's what's probably doing it then. The load average in Linux is the average number of processes trying to run on the processor in the period in question. Furthermore, internally to the Linux, each thread is its own process (at least with pthreads -- I think Java threads work the same way, unless the JVM is managing them all in user-space -- not totally sure how the JVM handles this internally).

I'm not sure if you can scroll down in top, but you can push "n" from within top to change the number of processes displayed. You can also use "u" to only display processes belonging to a particular user.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I check the CPU temp? abefroman Linux - Software 2 11-18-2005 01:47 AM
kernel: CPU 0: Machine Check Exception: 0000000000000004 Toadman Linux - General 4 05-27-2005 10:52 PM
No CPU temperatures with Gkrellm. ACPI? Can I check if it's in the kernel? hotuct23 Linux - Software 3 04-27-2004 10:31 PM
CPU check !!! TheShemeta Linux - General 3 10-19-2003 10:35 AM
CPU#0:Machine Check Exception karamboul Linux - Software 1 03-29-2002 10:33 PM


All times are GMT -5. The time now is 08:05 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration