Sponsored Content
Operating Systems Linux Red Hat Using "ps" command to find high processes Post 302826343 by rbatte1 on Wednesday 26th of June 2013 10:47:46 AM
Old 06-26-2013
You could look at the current C value from a ps command.
Code:
ps -ef | sort -nb -k4

You might need to check the column it is sorting on (I'm assuming the fourth) This should sort the processes based on what is busy that the moment. It's a little hit-and-miss I agree, but it can help. As a process is actually running, the counter gets incremented. When it is idle or swapped out it slowly reduces. This way, the process scheduler can determine which process is next in line so busy processes get (in theory) pushed out a little if the system is busy.

Of course processes will run as fast as they can, so they may get swapped in & out frequently. The trick is to run this a few times and compare the output. A process with a consistently high C value is busy - and you'll probably see the CPU time clocking up too.


How are you measuring your CPU use? If you just use something like:-
Code:
vmstat 1 1

... then the first (and only) line is the average since last boot. If the server has been very busy for a very long time, then that figure can be skewed. Can you post some sample stats and the commands you are getting them with? The tail end of the output from my ps command may help us to. Make sure you sanitise them if need be. We have plenty of users who start Oracle connections specifying the user/password on the command line for everyone to see.



To check the columns and their order, use:-
Code:
ps -ef | head -1

I hope that this helps,

Robin
Liverpool/Blackburn
UK

Last edited by rbatte1; 06-26-2013 at 11:56 AM.. Reason: Added questions
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

"find command" to find the files in the current directories but not in the "subdir"

Dear friends, please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories.. it is like this, current directory contains file1, file2, file3, dir1, dir2 and dir1 conatins file4, file5 and dir2 contains file6,... (9 Replies)
Discussion started by: swamymns
9 Replies

2. UNIX for Advanced & Expert Users

command for recently modified files - "find" command not working

I have three files a.txt , b.txt , c.txt in a directory called my_dir1 .These files were created before two or three months . I have a tar file called my_tar1.tar which contains three files a.txt , b.txt , d.txt . Somebody untarred the my_tar1.tar into my_dir1 directory. So existing two files were... (1 Reply)
Discussion started by: joe.mani
1 Replies

3. Shell Programming and Scripting

Identify high values "˙" in a text file using Unix command

I have high values (such as ˙˙˙˙) in a text file contained in an Unix AIX server. I need to identify all the records which are having these high values and also get the position/column number in the record structure if possible. Is there any Unix command by which this can be done to : 1.... (5 Replies)
Discussion started by: devina
5 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. Shell Programming and Scripting

Problem with "find" and "grep" command

I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank). In a first approach I coded: find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt But this doesn't work. I got an error (under Ubuntu): grep:... (5 Replies)
Discussion started by: pstein
5 Replies

6. Shell Programming and Scripting

Using sed to find text between a "string " and character ","

Hello everyone Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies

7. Shell Programming and Scripting

Find lines with "A" then change "E" to "X" same line

I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies

8. Shell Programming and Scripting

What is the use of "finger" command & how to use it to kill the online processes ?

Hi there, I am eager to know what exactly is the use of "finger" command & how to use it to kill the online processes ? :b: (1 Reply)
Discussion started by: abhijitpaul0212
1 Replies

9. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

10. Shell Programming and Scripting

find . -path "*_nobackup*" -prune -iname "*.PDF" \( ! -name "*_nobackup.*" \)

These three finds worked as expected: $ find . -iname "*.PDF" $ find . -iname "*.PDF" \( ! -name "*_nobackup.*" \) $ find . -path "*_nobackup*" -prune -iname "*.PDF" They all returned the match: ./folder/file.pdf :b: This find returned no matches: $ find . -path "*_nobackup*" -prune... (3 Replies)
Discussion started by: wolfv
3 Replies
acctcom(1M)															       acctcom(1M)

NAME
acctcom - search and print process accounting files SYNOPSIS
[[option]... [file]] ... DESCRIPTION
The command reads file, standard input, or in the form described in acct(4) and writes selected records to standard output. Each record represents the execution of one process. The output has the following column titles: Optionally, the following can be displayed: flag: for without System exit status Total blocks read and written PRM process resource group ID The command name is preceded by a if a privileged user is required to execute the command. For example, if a user is logged in as and executes the command to check the time, this does not require a privileged user, and will be shown by without the character on the line. If the user executes the command to set the time, this requires a privileged user, and so will be marked with a by If a process is not associated with a known terminal, a is printed in the field. The system exit status is if the process terminated by calling If it is not it is the signal number that caused the process to terminate. If a core file image was produced as a result of the signal (see signal(5)), the value is the signal number plus If no files are specified, and if standard input is associated with a terminal or (as is the case when using in a shell), reads Otherwise, it reads standard input. If any file arguments are given, they are read in their respective order. Each file is normally read forward, that is, in chronological order by process-completion time. The file is usually the current file to be examined. A busy system may need several such files of which all but the current file are found in Options recognizes the following values for the option argument. Listing options together has the effect of a logical AND. Show some average statistics about the processes selected. Statistics are printed after the output records. Read backwards, showing latest commands first. This option has no effect when standard input is read. Print in octal the flag and system exit status columns in the output. Instead of mean memory size, show the fraction of total available CPU time consumed by the process during its execution. This is computed as: Print columns containing the I/O counts in the output. Instead of memory size, show total kcore-minutes. Show mean core size (the default). Show the PRM process resource group ID of each process. See DEPENDENCIES. Show CPU factor: Show separate system and user CPU times. Exclude column headings from the output. Show only processes belonging to terminal Show only processes belonging to user, specified as: a user ID, a login name that is then converted to a user ID, a which designates only those pro- cesses executed by a privileged user, or which designates only those processes associated with unknown user IDs. The and characters should be preceded by a backslash and typed as and to prevent the shell from interpreting the as the start of a comment, or the as a pattern. Show only processes belonging to group, specified as either the group ID or group name. Select processes existing at or after time, given in the format: Select processes existing at or before time; see Using the same time for both and shows the processes that existed at time; see Select processes starting at or after time; see Select processes ending at or before time; see Show only commands matching pattern, where pattern is a regular expression as in ed(1) except that means one or more occurrences. Do not print any output records. Just print the average statistics as with the option. Copy selected process records in the input data format to ofile. Suppress standard output printing. Show only processes that exceed factor, where factor is the "hog factor" as explained in option Show only those processes with operating system CPU time exceeding time; see Show only processes with total CPU time, system plus user, exceeding sec seconds. Show only processes transferring more characters than the cut-off number given by chars. Show only processes belonging to process resource group prmgroup, specified as either process resource group name or ID number. See DEPENDENCIES. WARNINGS
only reports on processes that have terminated. For active processes, use the command (see ps(1)). If time exceeds the current system clock time, time is interpreted as occurring on the previous day. The accounting flag is not cleared when one processes exec's another, but only when one process forks another. One side-effect of this is that some processes will be marked with when users do not expect them to be. For example, the command requires a privileged user to assume the identity of the user who is logging-in, setting the ASU bit in the accounting flag (which ultimately causes the symbol in the output). After assuming the user's identity, exec's the user's shell. Since the exec does not clear the ASU flag, the shell will inherit it, and be marked with a in the output. The mean memory size may overflow for values greater than DEPENDENCIES
HP Process Resource Manager The and options require the optional HP Process Resource Manager (PRM) software to be installed and configured. See prmconfig(1) for a description of how to configure HP PRM, and prmconf(4) for the definition of process resource group. FILES
SEE ALSO
ps(1), su(1), acct(1M), acctcms(1M), acctcon(1M), acctmerg(1M), acctprc(1M), acctsh(1M), fwtmp(1M), runacct(1M), acct(2), wait(2), acct(4), utmp(4), signal(5). HP Process Resource Manager: prmconfig(1), prmconf(4) in STANDARDS CONFORMANCE
acctcom(1M)
All times are GMT -4. The time now is 10:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy