Tuesday, August 23, 2011

Memory Monitoring - AIX svmon command


The svmon command is an analysis tool for virtual memory.It captures the current state of memory, including real, virtual and paging space memory. The svmon command invokes the svmon_back command. Both are located in /usr/lib/perf, and both part of the perfagent.tools fileset.

Syntax
svmon [-G [-i Intvl [NumIntvl] ][-z] ]
svmon [-P [pid1...pidn][-r][-u|-p|-g|-v][-ns][-wfc][-q][-t Count][-i
Intvl [NumIntvl] ] [-l][-j][-z][-m] ]
svmon [-S [sid1...sidn][-r][-u|-p|-g|-v][-ns][-wfc][-q][-t Count][-i
Intvl [NumIntvl] ] [-l][-j][-z][-m] ]
svmon [-D sid1...sidn  [-b][-q][ -i Intvl [NumIntvl]][-z]]
svmon [-F [fr1...frn]  [-q][-i Intvl [NumIntvl] ][-z]]
svmon [-C cmd1...cmdn  [-r][-u|-p|-g|-v][-ns][-wfc][-q] [-t Count][-i
Intvl [NumIntvl] ] [-d] [-l] [-j] [-z] [-m] ]
svmon [-U [lognm1...lognmn][-r][-u|-p|-g|-v][-ns][-wfc][-t Count][-i
Intvl [NumIntvl] ] [-d] [-l][-j][-z][-m]]
svmon [-W [class1...classn][-e][-r][-u|-p|-g|-v] [-ns][-wfc][-q][-t
Count] [ -i Intvl [NumIntvl] ][-l][-j][-z][-m]]
svmon [-T [tier1...tiern][-a superclass][-x][-e][-r][-u|-p|-g|-v][-ns]
[-wfc] [-q] [-t Count][ -i Intvl [NumIntvl]] [-l][-z][-m] ]

If no option is given, svmon -G is the default.

Useful combinations of the svmon command
  • svmon or svmon -G
  • svmon -P
  • svmon -C
  • svmon –i

Using the svmon command

When you use the -G flag or give no flags with the svmon command, it will provide you with the global view. The global view shows system-wide memory utilization. In Example below, you can the amount of real memory pages that are in use and free are shown. The number of pg space pages inuse shows how much paging space is being used.

Example Example using svmon or svmon -G

To print out global statistics over an interval, use the -G flag. In Example below we will repeat it five times at two-second intervals.

Example Using svmon -G over an interval


The columns on the resulting svmon report are described as follows:

Memory  : Statistics describing the use of real memory, shown in 4 K pages.

Size
Total size of memory in 4 K pages.
Inuse
Number of pages in RAM that are in use by a process plus the number of persistent pages that belonged to a terminated process and are still resident in RAM. This value is the total size of memory minus the number of pages on the free list.
Free
Number of pages on the free list.
Pin
Number of pages pinned in RAM (a pinned page is
a page that is always resident in RAM and cannot
be paged out).


pg space : Statistics describing the use of paging space, shown in 4 K pages. This data is reported only if the -r flag is not
used. The value reported is the actual number of paging space pages used, which indicates that these pages were paged out to the paging space. This differs from the vmstat command in that the vmstat command's avm column which shows the virtual memory accessed but not necessarily paged out.

size
Total size of paging space in 4 K pages
inuse
Total number of allocated pages.


in use : Detailed statistics on the subset of real memory in use,
shown in 4 K frames.

Work
Number of working pages in RAM.
Pers
Number of persistent pages in RAM.
Clnt
Number of client pages in RAM (client page is a
remote file page).


Pin : Detailed statistics on the subset of real memory
containing pinned pages, shown in 4 K frames.

Work
Number of working pages pinned in RAM.
Pers
Number of persistent pages pinned in RAM.
clnt
Number of client pages pinned in RAM.



Using the svmon command, you can display memory usage statistics for processes. Using the -P flag, and specifying the process id (PID), If no PID is supplied it will provide statistics are displayed for all active processes. You can use Example below to read the output of the svmon -P command.


Example  Example using svmon –P



Process ID 68532 is using 80615 pages of real memory and no paging space. The svmon command can also be used to track memory being used by a specific command, by using the -C flag of the command. In Example above the -C flag is used to track the memory usage of the hagsd (in fact this is the high availability
group services daemon, part of RSCT) process. You can compare the output in Example above and Example below to see how the two flags relate to each other.

Example using svmon –C





3 comments: