|
Home > Archive > Unix Programming > September 2007 > CPU usage, process bind
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
CPU usage, process bind
|
|
| jagpreet 2007-09-19, 7:31 am |
| Hi There,
I have written a script which shows the status of the running
application.
shows mem usage, cpu no. , pid etc.
used ps -efl to get that information.
ps -efl |grep $MY_PROCESS |grep -v "grep" | awk '{printf("%9s %19s
%18s %11s",$6,$4,$12,$10)}'
I want to add CPU usage as well for each process of that application.
But thats option is not available in HP-UX.(ps -efo which I find on
net after googling)
can I use something else(like top, again googling).
But top is not helping me much for the same.
what are the options I can use.
Further, is there a way to know the processors(cpu#) available on
perticular server. and is there a way to distribute the processes
among them.(pbind is not available in HP-UX).
regards
Jagpreet
| |
| Don Morris 2007-09-19, 1:27 pm |
| jagpreet wrote:
> Hi There,
> I have written a script which shows the status of the running
> application.
> shows mem usage, cpu no. , pid etc.
>
> used ps -efl to get that information.
>
> ps -efl |grep $MY_PROCESS |grep -v "grep" | awk '{printf("%9s %19s
> %18s %11s",$6,$4,$12,$10)}'
>
> I want to add CPU usage as well for each process of that application.
>
> But thats option is not available in HP-UX.(ps -efo which I find on
> net after googling)
Um, say what?
http://docs.hp.com/en/B2355-90690/ps.1.html
(start quote)
-l
Show columns flags, state, uid, pid, ppid, cpu, intpri, nice, addr, sz,
wchan, tty, time, and comm, in that order.
(end quote)
Maybe the order is different from what you expect (my awk skills are
non-existent) -- but ps -efl most definitely produces output that
includes CPU time:
401 S root 15583 15582 0 154 20 e00000015d617b00 133
e00000015eb4bb68 Sep 7 pts/tc 0:00 ksh
(sample from an rx2600, r11.31... pretty much idle, hence no significant
time).
> can I use something else(like top, again googling).
>
> But top is not helping me much for the same.
>
> what are the options I can use.
>
>
> Further, is there a way to know the processors(cpu#) available on
> perticular server. and is there a way to distribute the processes
> among them.(pbind is not available in HP-UX).
man pstat_getdynamic() or http://docs.hp.com/en/B2355-90693/pstat.2.html
(See Example 2 where they in fact get information on each processor).
The OS itself will distribute processes among them based on load
balancing. If you need/want to override that or adjust it, mpsched
should do it [man 1 mpsched].
Don
|
|
|
|
|