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
MD-MX-CTRL(8)						      System Manager's Manual						     MD-MX-CTRL(8)

NAME
md-mx-ctrl - Control mimedefang-multiplexor SYNOPSIS
md-mx-ctrl [options] command DESCRIPTION
md-mx-ctrl is a command-line tool for communicating with mimedefang-multiplexor(8). OPTIONS
-h Displays usage information. -s path Specifies the path to the mimedefang-multiplexor socket. If not specified, defaults to /var/spool/MIMEDefang/mimedefang-multi- plexor.sock. -i This flag causes md-mx-ctrl to sit in a loop, reading commands on standard input and printing results to standard output. It is intended for use by a monitoring program such as watch-mimedefang. COMMANDS
The following commands are available: status Prints the status of all slave Perl processes in human-readable format. rawstatus Prints the status of all slave Perl processes in a format easy to parse by computer. The result is a single line with six words on it. The words are separated by a single space character. Each character in the first word corresponds to a slave, and is "I" for an idle slave, "B" for a busy slave, "S" for a slave which is not running, and "K" for a slave which has been killed, but has not yet exited. A slave is "idle" if there is a running Perl process waiting to do work. "Busy" means the Perl process is currently filtering a message. "S" means there is no associated Perl process with the slave, but one can be started if the load warrants. Finally, "K" means the slave Perl process has been killed, but has yet to terminate. The second word is the total number of messages processed since the multiplexor started up. The third word is the total number of slaves which have been activated since the multiplexor started up. (That is, it's a count of the number of times the multiplexor has forked and exec'd the Perl filter.) The fourth word is the size of the queue for request queuing, and the fifth word is the actual number of requests in the queue. The sixth word is the number of seconds elapsed since the multiplexor was started. barstatus Prints the status of busy slaves and queued requests in a nice "bar chart" format. This lets you keep an eye on things with a script like this: while true ; do md-mx-ctrl barstatus sleep 1 done histo Prints a histogram showing the number of slaves that were busy each time a request was processed. A single line is printed for the numbers from 1 up to the maximum number of slaves. Each line contains the count of busy slaves (1, 2, 3 up to MX_MAXIMUM), a space, and the number of times that many slaves were busy when a request was processed. load Prints a table showing "load averages" for the last 10 seconds, 1 minute, 5 minutes and 10 minutes. Each row in the table corresponds to a time interval, displayed in the first column. The remaining columns in the table are: Msgs: The number of messages scanned within the row's time interval. Msgs/Sec: The average number of messages scanned per second within the row's time interval. Avg Busy Slaves: The average number of busy slaves whenever a message was scanned. (If you are processing any mail at all, this number will be at least 1, because there is always 1 busy slave when a message is scanned.) If you have the watch(1) command on your system, you can keep an eye on the load with this command: watch -n 10 md-mx-ctrl load If you do not have watch, the following shell script is a less fancy equivalent: #!/bin/sh while true; do clear date md-mx-ctrl load sleep 10 done rawload Prints the load averages in computer-readable format. The format consists of twenty-nine space-separated numbers: The first four are integers representing the number of messages scanned in the last 10 seconds, 1 minute, 5 minutes and 10 minutes. The second four are floating-point numbers representing the average number of busy slaves in the last 10 seconds, 1 minute, 5 min- utes and 10 minutes. The third four are floating-point numbers representing the average time per scan in milliseconds over the last 10 seconds, 1 minute, 5 minutes and 10 minutes. The fourth four are the number of slave activations (new slaves started) over the last 10 seconds, 1 minute, 5 minutes and 10 min- utes. The fifth four are the number of slaves reaped (slaves that have exited) over the last 10 seconds, 1 minute, 5 minutes and 10 min- utes. The sixth four are the number of busy, idle, stopped and killed slaves. The seventh four are the number of messages processed, the number of slave activations, the size of the request queue, and the num- ber of requests actually on the queue. The final number is the number of seconds since the multiplexor was started. load-relayok Similar to load, but shows timings for filter_relay calls. load-senderok Similar to load, but shows timings for filter_sender calls. load-recipok Similar to load, but shows timings for filter_recipient calls. rawload-relayok Similar to rawload, but shows timings for filter_relay calls. Note that the slave activation and reap statistics are present, but always 0. They are only valid in a rawload command. rawload-senderok Similar to rawload, but shows timings for filter_sender calls. Note that the slave activation and reap statistics are present, but always 0. They are only valid in a rawload command. rawload-recipok Similar to rawload, but shows timings for filter_recipient calls. Note that the slave activation and reap statistics are present, but always 0. They are only valid in a rawload command. slaves Displays a list of slaves and their process IDs. Each line of output consists of a slave number, a status (I, B, K, or S), and for idle or busy slaves, the process-ID of the slave. For busy slaves, the line may contain additional information about what the slave is doing. busyslaves Similar to slaves, but only outputs a line for each busy slave. slaveinfo n Displays information about slave number n. reread Forces mimedefang-multiplexor to kill all idle slaves, and terminate and restart busy slaves when they become idle. This forces a reread of filter rules. msgs Prints the total number of messages scanned since the multiplexor started. ADDITIONAL COMMANDS
You can supply any other command and arguments to md-mx-ctrl. It percent-encodes each command-line argument, glues the encoded arguments together with a single space between each, and sends the result to the multiplexor as a command. This allows you to send arbitrary com- mands to your Perl slaves. See the section "EXTENDING MIMEDEFANG" in mimedefang-filter(5) for additional details. PERMISSIONS
md-mx-ctrl uses the multiplexor's socket; therefore, it probably needs to be run as root or the same user as mimedefang-multiplexor. AUTHOR
md-mx-ctrl was written by David F. Skoll <dfs@roaringpenguin.com>. The mimedefang home page is http://www.mimedefang.org/. SEE ALSO
mimedefang.pl(8), mimedefang-filter(5), mimedefang(8), mimedefang-protocol(7), watch-mimedefang(8) 4th Berkeley Distribution 8 February 2005 MD-MX-CTRL(8)
All times are GMT -4. The time now is 07:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy