Operating System - HP-UX
1828474 Members
3132 Online
109978 Solutions
New Discussion

Command line memory monitoring

 
SOLVED
Go to solution
Yann Lambret
Occasional Advisor

Command line memory monitoring

Hi all,

I think this subject was probably discussed many times, but I could not find any answer - even on this forum - that completely helped.

I'd like to get regular memory stats and store them in a basic text file, in order to process them later with a perl script.

Information I look for is :

- buffer cache size
- pages number that are used (minus the buffer cache)
- pages number that are page out or swapped out

To sum up, I'd like to know easily if my system is under memory pressure or not, nothing really special... :)

It doesn't seem to me that vmstat provide all this information, and I know I could use glance but it doesn't fit my needs (maybe I'm wrong, I'm quite new in HP-UX administration).

HP-UX virtual memory implementation is rather complex, and I feel like each memory monitoring tool provide a part of what I'd like to know.

Can anyone give me some clue about the way to handle this ?

Sorry - again - for my approximative english.

Yann
7 REPLIES 7
Tiziano Contorno _
Valued Contributor

Re: Command line memory monitoring

Hi, Yann, you could use the standard measureware scopeux that monitor each resource.

I run a script that extract data in a xls file, then I ftp the files to a windows machine where I plot the datas with excel.

You can look at the link below where I posted the extract command and a configuration file aimed to gather memory and swap info, but I suggest you to go deeper in the reptfile metrics you can use.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1006074
Bill Hassell
Honored Contributor

Re: Command line memory monitoring

Actually, memory management is very complex for most flavors of Unix. The concept of a program using a fixed amount of RAM and the kernel occupying another part of RAM is simplistic to a fault. There are shared memory elements such as runtime libraries and inter-program shared memory areas, the dynamic buffer cache which adjusts it's size when available RAM is low, etc, all making various memory metrics very misleading and difficult to correlate.

The simplest metric is vmstat -s in conjunction with vmstat -z. vmstat -s gives you a list of 1-liners (vmstat without options is a pain to script), but the most important "memory pressure" metric is page out (use grep to isolate that line from vmstat -s). This is the number of pages that were forced out to the swap area because there is no room in RAM. Single digits (0-9) are normal and of no concern, 2 digits (10-99) is an indication that RAM is short, and 3 digits or more indicates severe memory shortage.

Now it is normal for short bursts of page-outs to occur, especially in an interactive system (where users think for a while between transactions). Use the vmstat -z option to clear the counters so the values are meaningful over a short measurement period, like 5 mins. Page in is not meaningful because HP-UX starts all programs by paging in the various parts of the program from it's executable file, as well as paging in a program which was previously paged out to the swap area. This one metric is the best indicator of memory pressure since it has a huge impact on overall system performance.


Bill Hassell, sysadmin
Yann Lambret
Occasional Advisor

Re: Command line memory monitoring

Thanks to both of you for the answers.

It doesn't seem like extract is designed to provide regular "samples" of system memory, am I wrong about this ?

Otherwise I didn't know about these vmstat options. I think they're going to be useful in my case. Sorry to be so picky but can I combine vmstat with something else so that I can get a general idea of memory usage --> the purpose is to generate some graphs, and I wouldn't have so many things to graph if the server doesn't page out...
Tiziano Contorno _
Valued Contributor

Re: Command line memory monitoring

Actually extract shows what is logged.

You could create an application group for your procs and tune the logging thereshold value in the same file.

Have a look at:
/opt/perf/examples/mwaconfig/parm_apps
/var/opt/perf/parm #here the config to create groups and tune thereshold
man mwa
man midaemon

Regards.
Yann Lambret
Occasional Advisor

Re: Command line memory monitoring

Thanks Vanadio,

Now I'm more familiar with the mwa operation, ant outputs provided is indeed just what I need. However, I've read both /opt/perf/examples/mwaconfig/parm_apps and /var/opt/perf/parm very carefully and I didn't find out how to change the measures rate.

I did a quick export test about CPU load and got this ouptut :

Date |Time |CPU % |
03/02/06|00:00| 8.33|
03/02/06|00:05| 14.35|
...

Is the CPU load an average value for a 5 minutes interval, or is it an instantaneous value --> couldn't find information in man pages or file comments. In this case I'd like to turn down the test rate to 1 minute.

Thanks again, I really appreciate the support.
Tiziano Contorno _
Valued Contributor
Solution

Re: Command line memory monitoring

Extractable data have a "granularity" of 5 min :(
Default is 60 min.
Value reported is the media of values in the interval.
Mind that if the thereshold is not reached the value extracted is as set in reptfile MISSING value.

Regards.
Yann Lambret
Occasional Advisor

Re: Command line memory monitoring

Thanks again Vanadio,

I didn't know mwa at all. I going to dig a little deeper... :)