[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Creating a log file of HPUX Memory Usuage

Posted on 2010-11-25
13
Medium Priority
?
1,646 Views
Last Modified: 2012-05-10
Hello

We have recently introduced a 'web' version of an application which has been running for some time on an HPUX server.

It seems the web version is much more RAM intensive than the character version & users are complaining the application is running too slowly.

I can monitor memory useage in 'real time' using GlancePlus - it has been suggested that 'top' is not reliable for memory monitoring, but is it possible to write a file of what the memory useage is over a period of time? E.g. memory used/available/page file useage checked (for instance) every 15mins so we can get an overview of RAM over a period of time?

Thanks in advance for any help!
0
Comment
Question by:_Sparky
  • 5
  • 4
  • 2
  • +1
13 Comments
 
LVL 21

Expert Comment

by:flow01
ID: 34213786
we used 2 options for gathering the data but both use the 'top'-command

option 1 : scheduling a unix-script in crontab with a certain interval

script-content:
webloadfile=/tmp.new/webloadlist_`hostname`
top -d1 -n1 -f $webloadfile  # top
echo `ps -ef | grep -c frmweb` runform >> $webloadfile  # nr of oracle forms sessions
echo `ps -ef | grep -c oracleORA` sessies >> $webloadfile # nr of oracle database-sessions

option 2 : use a looping unix-script

script_content:
let "i1 = 0"
until test $i1 -gt 1000 # more then 3 days
do
  let "i1 = i1 + 1"
  sleep 300 # wait 5 minutes
  top -d1 -n1 > /tmp.new/top
  cat /tmp.new/leeg /tmp.new/top >> /tmp.new/top_verloop
  date
done


we prefer option 1 because if something in the script went wrong  the datagathering continues when the problem is solved

Filtering the desired output from the resulting file is another problem : we used an oracle pl/sql script to read the file and select the data from it
0
 
LVL 21

Expert Comment

by:flow01
ID: 34213801
Does your application involve  oracle forms ?  
0
 
LVL 62

Expert Comment

by:gheist
ID: 34214641
you can get memory usage and system load and disk usage from snmp....
nagios is very good, mrtg works with tweaking, and HP sells best for HP-UX - OpenView
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:_Sparky
ID: 34215962
Hi,

The application is Progress (not Oracle) - We're still running the 'character' version but also now the web version (via webspeed brokers)

It seems the avaiable RAM has dropped dramatically since users have started logging in to the webspeed brokers & there is a noticable difference in general performance.  From sitting & 'watching' GPM it does look as though the server's paging but I need to be able to 'proove' that without having to invite other people to sit & watch GPM with me!

I took a look at the man page for snmp (snmpdm) but I have to be honest - it didn't make much much sense!  There seem to be all sorts of 'versions' of snmp from 3rd party vendors which is it that you suggest?

Thanks!
0
 
LVL 62

Expert Comment

by:gheist
ID: 34216892
snmp daemon only publishes the information.
you need some tool to collect it after.
0
 
LVL 21

Expert Comment

by:tfewster
ID: 34229989
`sar` (System Activity Reporter/Recorder) isn't as accurate* as Glance, but takes a snapshot of all system usage at user-defined times and logs it for later review so, if you wanted to see what I/O activity was taking place when memory usage jumped, you can analyse/graph it later.

Look at the man page for `sa1`for suggested cron setup; You could set it to log every minute during "peak times", e.g. when staff log in, then less frequently during the day.

Make sure you have plenty of space in /var!

* Like `top`, `sar` doesn't have the kernel hooks that Glance has, so can't be as precise, but gives a good indicator as to where to investigate further
0
 

Author Comment

by:_Sparky
ID: 34230607
Hi

This looks like the 'kind' of thing I'm looking for but will sa1 give me memory stats?  Also.....  How do I 'read' the file(s) that it produces?
0
 
LVL 21

Expert Comment

by:tfewster
ID: 34238280
Oops - `sar` doesn't show memory info. `vmstat` does that, but it doesn't log. Might as well stick with the terminal version of Glance:

glance -m -j 900  -f /tmp/glance_memory.out    # -m being "memory"

This starts the terminal version onscreen but logs the output for later review. I don't have access to an HP-UX system at the moment, so I'm not sure about the output format or if it could be graphed.
0
 

Author Comment

by:_Sparky
ID: 34238555
The glance command you gave above does give exactly the info I'm looking for....

But the format's exactly what you see on the screen and just repeated for each refresh interval so I don't think I'd be able to use it later - also, I assume you'd need to leave a telnet (or similar) connection running 'on screen'

Is there anyway I can get that information, just written to a file that could be used later?
0
 
LVL 21

Expert Comment

by:tfewster
ID: 34238797
Yes, it does just copy the screen display to a file, and you have to quit glance manually. HP sell MeasureWare/Perfview for the purpose of regular monitoring.

I'd use awk to extract the key info I wanted from the file (e.g. timestamp and the summary stats) so they could be displayed/graphed. If I recall correctly, the output contains formatting characters so `grep` isn't much use.  If you want to attach an output file with a few iterations and a specification of exactly which fields to extract, I'll have a go at it.
0
 

Author Comment

by:_Sparky
ID: 34247247
I've attached a copy of the .out file

I changed the interval to 30secs & ran it for a couple of mins just to get a few 'pages' included.

All I really need from the file are the four fields at the top of the page - memory util% disk% cpu% & swap%

Thanks
glance-memory.out.txt
0
 
LVL 21

Accepted Solution

by:
tfewster earned 2000 total points
ID: 34263271
A quick and dirty:
sed -e 's/%//g' glance-memory.out.txt |
awk 'BEGIN {print "Timestamp,CPU,Disk,Mem,Swap"}
$1 ~ /B3692A/ {printf $4; printf ","}
$1 ~ /CPU|Disk|Mem/ {printf $5;printf ","}
$1 ~ /Swap/ {print $5}' > glance-extract.csv


gives a file suitable for import into Excel for graphing:
Timestamp,CPU,Disk,Mem,Swap
13:10:32,24,96,72,52
13:11:02,18,95,71,51
13:11:32,13,100,72,51

Of course, if that's an example from the server in question, your problem is disk I/O, not memory!
0
 

Author Closing Comment

by:_Sparky
ID: 34266560
Thanks for the help, that now gives me exactly what I need!

(I know about the disk I/O problem on that server - 1 problem at a time!)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month18 days, 1 hour left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question