Sponsored Content
Top Forums Shell Programming and Scripting Understanding the output of TOP Post 302436231 by SkySmart on Friday 9th of July 2010 08:17:51 PM
Old 07-09-2010
Understanding the output of TOP

ok, so I have a script im running on a linux box that uses "egrep" a lot. now, when i run this script, i check the TOP to see how much system resource it is using.

the "top" command gives the following output:

Code:
last pid: 25384;  load avg:  1.06,  1.04,  0.76;       up 351+06:30:24                                                                                                                           00:10:08
139 processes: 2 running, 136 sleeping, 1 zombie
CPU states: 93.5% user,  0.0% nice,  6.3% system,  0.0% idle,  0.2% iowait
Kernel: 8 newproc
Memory: 5149M used, 2965M free, 303M buffers, 1341M cached
Swap: 6840K used, 1986M free, 1844K cached

  PID USERNAME  THR PRI NICE  SIZE   RES STATE   TIME    CPU COMMAND
25174 root        1  25    0 4256K  716K run     0:24 99.59% egrep
14120 www         1  15    0  127M  110M sleep   0:08  8.00% mongrel_rails
10243 root        1  15    0   48M   45M sleep  46.1H  3.60% ruby
 8880 www         1  15    0  146M  131M sleep   0:12  1.80% mongrel_rails
18157 www         1  15    0  155M  140M sleep   0:21  0.60% mongrel_rails

In the above output, it shows that the egrep command is using 99% of the CPU. does this mean it is actually taking up 99% of the entire CPU resource of the system, which would mean there's only 1% left for the other numerous processes on the system to use? this can't be right.

What do I need to look at in the above output to determine or isolate the system impact of this script i'm running.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

capturing output from top and format output

Hi all, I'd like to capture the output from the 'top' command to monitor my CPU and Mem utilisation.Currently my command isecho date `top -b -n1 | grep -e Cpu -e Mem` I get the output in 3 separate lines.Tue Feb 24 15:00:03 Cpu(s): 3.4% us, 8.5% sy .. .. Mem: 1011480k total, 226928k used, ....... (4 Replies)
Discussion started by: new2ss
4 Replies

2. Shell Programming and Scripting

top output for six processes with the same name, output changed from column to row

Hi, I have a system under test, and I use a script that does a ps. The output, is in the following format, it's basically the timestamp, followed by the rss and vsize. 09:03:57 68404 183656 68312 181944 69860 217360 67536 182564 69072 183172 69032 199276 09:04:27 68752 183292 70000 189020... (5 Replies)
Discussion started by: Bloke
5 Replies

3. UNIX for Dummies Questions & Answers

Understanding the output command

Could you please explain me whats happening in the below code, appreciate your help, Thank you. /product/apps/informatica/v7/pc/ExtProc/NewDAC/dacRecBuilder.sh /product/apps/informatica/v7/pc/TgtFiles/NEW_DAC/DAC_Pos_TradeInv_Records.out ... (5 Replies)
Discussion started by: Ariean
5 Replies

4. Solaris

top output and swap -s output are differing

Solaris experts, Am struggling, and wondering for the past more than one week that, how to calculate the total available and used memory/swap space. Finally installed and used top & got some understanding, but while cross-checking, there are mismatches. Main Memory top o/p - 2GB... (7 Replies)
Discussion started by: thegeek
7 Replies

5. UNIX for Dummies Questions & Answers

Understanding nm command output

After running nm command on any object file from out put can we get to know that wheather a symbol is a call to a function or definition of function ? I am searching a class and function definitions inside many .so files. I have 3 files which contain the symbol but I don't know wheather they... (2 Replies)
Discussion started by: yatrik007
2 Replies

6. HP-UX

Understanding top in HP-UX

Understanding top and swapinfo command HP-UX Hi!I am new to HP-UX having used Linux for several years.When I want to check server performance,I use the top and swapinfo command.In Linux,the results of top were quite easy to understand as it would clearly state the amount of free and used... (0 Replies)
Discussion started by: joey41
0 Replies

7. Shell Programming and Scripting

Understanding the output of fwtmp

Hi all, First time post, so please be gentle. :) I'm writing a Solaris 10 ksh script to retrieve details of logins and logouts using specific user names. The details I want are quite basic - the username, the computer logged in from, and the date and time the user logged in and logged off.... (6 Replies)
Discussion started by: confusedAdmin
6 Replies

8. HP-UX

Understanding "top" command

Hi all, I need a clarification about the top command in HP-UX. If I run: top -s300 I see the screen refresh every 5 minutes. From the "man top" I understand that the values displayed every 5 minutes are instantaneous, not average on the previous 5 minutes. Is this interpretation correct? ... (3 Replies)
Discussion started by: Evan
3 Replies

9. Red Hat

Command understanding the output file destination in case of standard output!!!!!

I ran the following command. cat abc.c > abc.c I got message the following message from command cat: cat: abc.c : input file is same as the output file How the command came to know of the destination file name as the command is sending output to standard file. (3 Replies)
Discussion started by: ravisingh
3 Replies

10. Red Hat

Understanding cpu consumption with TOP

Hi please see attached picture of the TOP command. the "java" process seem to consume 700% of cpu is that mean that he uses 100% of every 7 cpu cores? thanks (2 Replies)
Discussion started by: guy3145
2 Replies
service(8)						      System Manager's Manual							service(8)

NAME
service - run a System V init script SYNOPSIS
service SCRIPT COMMAND [OPTIONS] service --status-all service --help | -h | --version DESCRIPTION
service runs a System V init script in as predictable environment as possible, removing most environment variables and with current working directory set to /. The SCRIPT parameter specifies a System V init script, located in /etc/init.d/SCRIPT. The supported values of COMMAND depend on the invoked script, service passes COMMAND and OPTIONS it to the init script unmodified. All scripts should support at least the start and stop commands. As a special case, if COMMAND is --full-restart, the script is run twice, first with the stop command, then with the start command. service --status-all runs all init scripts, in alphabetical order, with the status command. EXIT CODES
service calls the init script and returns the status returned by it. FILES
/etc/init.d The directory containing System V init scripts. ENVIRONMENT
LANG, TERM The only environment variables passed to the init scripts. SEE ALSO
/etc/init.d/skeleton, update-rc.d(8), init(8), invoke-rc.d(8). Jan 2006 service(8)
All times are GMT -4. The time now is 10:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy