cancel
Showing results for 
Search instead for 
Did you mean: 

Memory Usage by User.

 
Barakati
Frequent Advisor

Memory Usage by User.

Hi

Could anybody show me how to find memory and cpu usage by each user and porcess.


Thanks in advance.
14 REPLIES
Barakati
Frequent Advisor

Re: Memory Usage by User.

Version: HP_UX 11.31
Ganesan R
Honored Contributor

Re: Memory Usage by User.

Hi,

You can see the cumulative usage of memory and cpu systemwise and userwise by using top, sar, glance.

If you want to know the memory usage per process you can use the too1 kmeminfo.
Best wishes,

Ganesh.
Asif Sharif
Honored Contributor

Re: Memory Usage by User.

Hi,

use glance /kmeminfo.

Regards,
Asif Sharif
Venkatesh BL
Honored Contributor

Re: Memory Usage by User.

'top' shows the process specific breakup of cpu%, mem (RES) etc.
Sani
Frequent Advisor

Re: Memory Usage by User.

Hi ,

glance will give all such information.
Johnson Punniyalingam
Honored Contributor

Re: Memory Usage by User.

Hi ,

You can run Glance, will show memory and CPU usage by each user.
(more info man glance)

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
T G Manikandan
Honored Contributor

Re: Memory Usage by User.

ps -e -o ruser,pid,vsz=Kbytes --sort user|grep
T G Manikandan
Honored Contributor

Re: Memory Usage by User.

The above would be just an approximation of usage and hence called virtual size, to get the right usage use tools like Glance Plus.
Barakati
Frequent Advisor

Re: Memory Usage by User.

Actually i am trying to get total memory used by all processes owned by each user.

With glance i could see only a subset of process owned by each process.

On my HP_UX server memory is 98% used on an avg as seen by glance. I would like to know i) what user consumes how much memory.

Could you please clarify.

Re: Memory Usage by User.

UNIX95= ps -e -o vsz=Kbytes -o pid,args=Command-Line | sort -rnk1
Barakati
Frequent Advisor

Re: Memory Usage by User.

Hi,

I read one website stating..
For Example,

# UNIX95= ps -eo vsz,ruser,pid,args | sort -rn | more
26332 ids 1685 ./idsagent -a
5296 root 2178 /usr/sbin/stm/uut/bin/tools/monitor/fpl_em
4760 root 2713 /opt/perf/bin/rep_server -t SCOPE /var/opt/perf/datafiles/loggl
4068 root 1487 /opt/perf/bin/scopeux
4052 root 1243 /opt/dce/sbin/rpcd
3364 root 2715 /opt/perf/bin/alarmgen -svr 2714 -t alarmgen /var/opt/perf/data
3180 root 1465 /opt/perf/bin/midaemon
3148 root 1495 /usr/sbin/swagentd -r

And then look at the 1st column in the output to see the amount of memory used by this process for data/text and stack. This value is in pages, so multiply by 4096 to determine the size in bytes. Anytime you see that the size (SZ) is a four-digit number, that's relatively large, so it's one to watch over time and to see if it continues to grow, and therefore may have a memory leak.


Then i tried this.


#UNIX95= ps -eo vsz,ruser,pid,args | sort -rn | awk '{ val +=$1} END {print (val*4096)/(1024*1024*1024)}'
144.494

Do you think this value is in GB.
Is that means currently my machine using 144.494 GB? i do not think. I am trying to get the complete usage on my memory by all users. then by each users.
Is that possible using above command.

Please clarify.
Barakati
Frequent Advisor

Re: Memory Usage by User.

Thanks all i get it.

i did not concentrated on "vsz".
UNIX95= ps -eo ruser,pid,args,vsz=Kbytes |grep applmgr | awk '{ val +=$4} END {print (val)/(1024*1024)}'

will give me memory used by user "applmgr" in GB.

But if it is actual. How can i get actual using commands like this?

Thanks
Barakati
Frequent Advisor

Re: Memory Usage by User.

Hi Experts,

Do you think this command gives exact or very close to actual memory used by the user.

Because when i check the same on glance it is totally different.

with this command i sam 42.067 mb used by one user.

and it more than 500 mb on glance by the same user.

Any hints where i am going wrong.
Sandeep Verma
Occasional Advisor

Re: Memory Usage by User.

Hi,

you can use the HP tool kmeminfo to get the memory usage by user process and Kernel.

for CPU usage, please check
# top -d5 s10
# sar -Mu 2 10