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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
02-05-2005, 12:31 AM
|
#1
|
Member
Registered: Aug 2004
Posts: 88
Rep:
|
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...
|
|
|
02-05-2005, 12:32 AM
|
#2
|
Senior Member
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154
Rep:
|
top
|
|
|
02-05-2005, 01:07 AM
|
#3
|
LQ Newbie
Registered: Sep 2003
Location: Brunssum
Distribution: Debian own distribution
Posts: 18
Rep:
|
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 ;-)
|
|
|
02-05-2005, 06:49 AM
|
#4
|
Member
Registered: Oct 2004
Distribution: Fedora 7, OpenSuse 10.2
Posts: 108
Rep:
|
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.
|
|
|
02-05-2005, 12:48 PM
|
#5
|
Member
Registered: Aug 2004
Posts: 88
Original Poster
Rep:
|
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?
|
|
|
02-05-2005, 12:53 PM
|
#6
|
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290
|
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.
|
|
|
02-05-2005, 01:00 PM
|
#7
|
Member
Registered: Aug 2004
Posts: 88
Original Poster
Rep:
|
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?
|
|
|
02-05-2005, 02:20 PM
|
#8
|
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290
|
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.
|
|
|
All times are GMT -5. The time now is 05:19 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|