Hello.
First, excuse my poor english.
I try to monitor a dysfonction process which cause an excessive cpu consumption with the ps -ef command on AIX 5.3 TL08.
The C column indicates the cpu recently used. But I don't know the units of that C column.
Is it the "Scheduled time" of the process cpu using or a total cpu percent ?
How can I convert this value in the " % CPU used " indicates by nmon or topas
or
How Can I obtain the nmon (or topas) value (I have already tried getprocs64)
The man page of ps says following for the C column:
Quote:
C
(-f, l, and -l flags) CPU utilization of process or thread, incremented each time the system clock ticks and the
process or thread is found to be running. The value is decayed by the scheduler by dividing it by 2 once per
second. For the sched_other policy, CPU utilization is used in determining process scheduling priority. Large
values indicate a CPU intensive process and result in lower process priority whereas small values indicate an I/O
intensive process and result in a more favorable priority.
I guess that value can just vary on different boxes with different applications running on them. It sounds for me as if this is just to be taken in relationship in it's own respect.
I just checked it on one of our busy boxes and all processes are 0 in that case. So maybe it is not the best way to judge if a process uses a lot of CPU time - you simply have to see if there is any difference when your defunct process shows up.
Maybe use something like:
.. and look for the %CPU column and the STAT column (ie. what nmon and topas show for process activity too).
If this doesn't help for your question and you don't get another more insightful answer how this value of the C column takes effect in calculating cpu times, maybe open up a parallel thread in the IBM Developer's community.
Thank you for your reply Zaxxon.
cpu% shown by the "ps aux" is an average since the process started and the value is very low if the process is not restarted but suddenly malfunctions. That's what I'm trying to detect to issue an alert.
The top of unix, or topas or nmon Aix gives the instantaneous value of consumption cpu. But I can not configure it correctly on topas or nmon to get it and I thought that the ps command would be more appropriate.
cpu% shown by the "ps aux" is an average since the process started
I doubt that. It is a somewhat current snapshot of the value. Where did you read that?
---------- Post updated at 01:27 PM ---------- Previous update was at 01:24 PM ----------
Stupid me, sorry you are correct. The value does not change on repeating the command and the man page states it is the value since process start ie. average.
Tried that out too, but is the same as %CPU in aux; man page:
---------- Post updated at 01:55 PM ---------- Previous update was at 01:40 PM ----------
An update for the C column - not sure if you already found that; from the Performance Tools Handbook (Redbook):
Quote:
8.2.3 Displaying the processes in order of being penalized
The following command line is useful for determining which processes are being
penalized by the Virtual Memory Manager. See 1.2.2, “Processes and threads”
on page 6 for details about penalizing processes. The maximum value for the C
column is 120. The report in Example 8-6 displays the C column sorted in reverse
numerical order.
Example 8-6 Displaying the processes in order of being penalized
# ps -eakl | head -1 ; ps -eakl | sort -rn +5
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
303 A 0 1290 0 120 255 -- b016 8 - 8570:28 wait
303 A 0 1032 0 120 255 -- a815 8 - 8540:22 wait
303 A 0 774 0 120 255 -- a014 8 - 8568:09 wait
303 A 0 516 0 120 255 -- 9813 8 - 8590:49 wait
303 A 0 0 0 120 16 -- 9012 12 - 3:53 swapper
240001 A 0 25828 1 34 187 24 2040 1172 30bf6fd8 - 27:25 xmwlm
200001 A 0 36434 25250 4 181 20 da3e 460 pts/4 0:00 ps
240001 A 0 25250 29830 2 181 20 59ef 1020 pts/4 0:01 ksh
200001 A 0 36682 25250 2 181 20 69c9 300 30b4a6fc pts/4 0:00 sort
200001 A 0 34898 25250 2 181 20 4b6a 236 3098fce0 pts/4 0:00 head
...(lines omitted)...
Ignoring the wait processes, which will always show 120, the xmwlm process is
being penalized by the CPU. When this occurs, the process is awarded less CPU
time, thereby stopping xmwlm from monopolizing the CPU and giving more time
to the other processes.
---------- Post updated at 03:27 PM ---------- Previous update was at 01:55 PM ----------
Another update - you could check if any of the following produces any usable output for you:
Or try running pprof but problem is, that it runs for a given time like a trace - not sure if that is ok for you.
"The system contains a hardware timer which generates 100 interrupts/second. This interrupt will then dispatch the kernel scheduler process which runs at a fixed priority of 16. The scheduler will first charge the running thread with the 10 millisecond time slice and then dispatch another thread (context switch) of equal or higher priority on that CPU assuming there are other runnable threads. This short term CPU usage is reported in the “C” column when including a -l option with the ps command."
I hope this helps, although i think this disqualifies "ps -l" as a feasible source for your purposes.
Here is another link you might be interested in to read:
PS: To monitor the CPU consumption over time you might write a script which takes a snapshot of the "%CPU" value at fixed intervals and computes the actual consumption as a function over the time of the process running - some tricky calculations, but maybe worth a try.
Another idea is to run the process in question with the "time"-utility, which tells you the time spent in real-, user- and system-mode.
Hi 2 all,
i have had AIX 7.2
:/# /usr/IBMAHS/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built: May 25 2015 04:58:27
:/#:/# /usr/IBMAHS/bin/apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
... (3 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
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)
The system don't boot.
on the screen appears following:
press enter to maintenance (or type CTRL-D to continue)...I checked with format command.
... the slices "0-root","1-swap","2-backup" exist.
...the slises "3-var","6-usr" -unassigned. :( (16 Replies)
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)
Hi guys,
I am still kinda new to Linux.
Script template I found on the net and adapted for our environment:
#!/bin/sh
#set -x
ADMIN="admin@mydomain.com"
ALERT=10
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
do
#echo $output
... (2 Replies)
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Hi,
I have a process that can be seen after "ps aux" command.
However when I do "top" command. This process
cannot be seen.
How can this happen? Is there anything wrong
with my code? (3 Replies)