|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
HOWTO: analyze memory usage on AIX, aka svmon "101"
THE command on AIX for examining memory on AIX is svmon. Frequently, just the command
svmon with no arguments (defaults as
svmon -G ) is enough to get an indication of whether there is a chance of major memory problems. (Note: the system I am displaying this from has 9G and has only been up for a few days, memory is not fully loaded. I will run the same commands from a smaller virtual system as well, to show differences between "ancient" systems such as my P615 - Power4, and "almost ancient" Power5 1. svmon -G Code:
michael@x054:[/home/michael]svmon -G
size inuse free pin virtual mmode
memory 2359296 1778880 580416 631814 794262 Ded
pg space 131072 2372
work pers clnt other
pin 446779 0 0 185035
in use 794262 0 984618A little hard to read - so a nice example for the man page is: 1b. svmon -G -O unit=auto,timestamp=on,pgsz=on,affinity=detail This command output is much easier to read - sizes behind it! Notice also the small paging space. With AIX you should not need paging space. IMHO - regular (I define this as more than 3 i/o per second) paging to from paging space indicates an application and/or configuration error. In short, DO NOT page to/from paging space (paging to/from file space aka persistent storage is normal i/o). Code:
michael@x054:[/home/michael]svmon -G -O unit=auto,timestamp=on,pgsz=on,affinity=detail
Unit: auto Timestamp: 18:54:42
--------------------------------------------------------------------------------------
size inuse free pin virtual available mmode
memory 9.00G 6.79G 2.21G 2.41G 3.03G 5.68G Ded
pg space 512.00M 9.27M
work pers clnt other
pin 1.70G 0K 0K 722.79M
in use 3.03G 0K 3.76G
Domain affinity free used total lcpus
0 - - - -
1 2.21G 6.05G 8.27G 3.71GOn a Power5 system, shared processor (oops!!) the same command works, but not for affinity. Code:
# svmon -G -O unit=auto,timestamp=on,pgsz=on,affinity=detail
-O affinity option not supported on shared machine
Unit: auto Timestamp: 12:58:11
--------------------------------------------------------------------------------------
size inuse free pin virtual available mmode
memory 672.00M 661.68M 10.3M 384.00M 933.96M 3.46M Ded
pg space 1.50G 314.87M
work pers clnt other
pin 353.25M 0K 0K 30.7M
in use 638.22M 0K 23.5M
PageSize PoolSize inuse pgsp pin virtual
s 4 KB - 426.30M 314.87M 256.68M 698.58M
Domain affinity *** not supported in shared pools ***
m 64 KB - 235.38M 0K 127.31M 235.38M
Domain affinity *** not supported in shared pools ***Note - The Power5 partition has a lot of information - relatively speaking - in paging space. But I also have only 672M memory assigned to the partition (VIOS running as IVM). Not a good production value, but sufficient - even necessary - as I need more memory in the client partitions. This is great for displaying some other svmon options - before I quit for the evening (more to come, and/or ask questions!) My next question is: what process is using the most paging space. On my old, but large P615 the answer is the "kernel", on my VIOS - some applications. 2. svmon -P -O sortentity=pgsp,unit=auto -t 3 Code:
michael@x054:[/home/michael]svmon -P -O sortentity=pgsp,unit=auto -t 3
Unit: auto
-------------------------------------------------------------------------------
Pid Command Inuse Pin Pgsp Virtual
0 swapper 34.5M 32.9M 0K 34.5M
1 init 75.5M 32.8M 0K 75.4M
4063360 writesrv 75.0M 32.8M 0K 75.0MCode:
# svmon -P -O sortentity=pgsp,unit=auto -t 3
Unit: auto
-------------------------------------------------------------------------------
Pid Command Inuse Pin Pgsp Virtual
6684878 java 111.73M 37.6M 37.3M 146.25M
6750284 java 158.79M 37.7M 30.0M 188.40M
7012408 cimserver 114.11M 37.6M 26.6M 136.34MSo, on the second system, I see two java processes in the top 3 sorted according to amount of paging space. Now a quick command to look at the detail of all the java commands: 3. svmon -C command_name | grep -v clnt The grep -v clnt is to remove all references to files that are open - as it can be MANY lines. You may actually want everything - for this post it is unnecessary. Code:
# svmon -C java | grep -v clnt
===============================================================================
Command Inuse Pin Pgsp Virtual
java 42077 9700 16516 57773
PageSize Inuse Pin Pgsp Virtual
s 4 KB 24461 9700 16516 40157
m 64 KB 1101 0 0 1101
...............................................................................
SYSTEM segments Inuse Pin Pgsp Virtual
9966 9692 778 10703
PageSize Inuse Pin Pgsp Virtual
s 4 KB 9966 9692 778 10703
m 64 KB 0 0 0 0
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
2002 0 work kernel segment s 9644 9580 675 10298
8198b9 - work s 263 79 27 290
803503 - work s 59 33 76 115
...............................................................................
EXCLUSIVE segments Inuse Pin Pgsp Virtual
14494 8 15738 29454
PageSize Inuse Pin Pgsp Virtual
s 4 KB 14494 8 15738 29454
m 64 KB 0 0 0 0
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
8028c2 3 work working storage s 12856 0 6888 19742
8084a8 3 work working storage s 1220 0 8641 9139
8108b0 f work working storage s 168 0 69 268
801441 f work working storage s 120 0 106 245
815855 2 work process private s 21 4 11 32
8174f7 2 work process private s 5 4 23 28
819879 c mmap maps 1 source(s) s 0 0 - -
81b53b e mmap maps 10 source(s) s 0 0 - -
8008c0 b mmap maps 16 source(s) s 0 0 - -
...............................................................................
SHARED segments Inuse Pin Pgsp Virtual
17617 0 0 17616
PageSize Inuse Pin Pgsp Virtual
s 4 KB 1 0 0 0
m 64 KB 1101 0 0 1101
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
9000 d work shared library text m 1101 0 0 1101
#In this output you would concentrate, initially, on the exclusive segment, and check the segments with lots of paging space activity. ======= Hope this primer on svmon helps with AIX system administration and memory diagnostics. Last edited by MichaelFelt; 03-02-2013 at 06:12 PM.. |
| The Following User Says Thank You to MichaelFelt For This Useful Post: | ||
filosophizer (03-02-2013) | ||
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
How to see shared/exclusive WORKING memory
svmon has MANY options - here I will show a few examples to extract the kind of info you may be trying to get with a traditional UNIX/Linux command such as
ps . main option is -P for process related information. The simplest command is: Code:
# svmon -P #default (long) output # svmon -P -O unit=auto #compact and human readable # svmon -P -O unit=auto,mpss=on # human readable variation of 1st command However, this still combines everything together like ps does (i.e. both shared and exclusive - and file caching). When trying to compare AIX memory usage to "other UNIX/Linux" output as reported by ps you need to remove file memory (the lines identified as clnt ). So, focusing on compact reports (just add mpss=on for long reports) To see shared memory (so only "count" it once, mpss=on output gives you the segment numbers if you want more detail) Code:
michael@x054:[/home/michael]svmon -P -O unit=auto,filtercat=shared,filtertype=working
Unit: auto
-------------------------------------------------------------------------------
Pid Command Inuse Pin Pgsp Virtual
5177436 sshd 35.3M 0K 0K 34.7M
5832898 sh 35.1M 0K 0K 34.7M
5570748 ksh 35.0M 0K 0K 34.7M
5898474 ksh 35.0M 0K 0K 34.7M
3080218 ksh 35.0M 0K 0K 34.7M
6553740 man 34.8M 0K 0K 34.7M
3670036 more 34.8M 0K 0K 34.7M
6160532 cat 34.8M 0K 0K 34.7M
6291578 svmon 0K 0K 0K 0KAnd to see the exclusive (count everytime!) use: Code:
michael@x054:[/home/michael]svmon -P -O filtercat=exclusive,filtertype=working,unit=auto
Unit: auto
-------------------------------------------------------------------------------
Pid Command Inuse Pin Pgsp Virtual
5177436 sshd 620K 12K 0K 620K
5832898 sh 532K 12K 0K 532K
5570748 ksh 588K 12K 0K 588K
5898474 ksh 576K 12K 0K 576K
3080218 ksh 576K 12K 0K 576K
6553740 man 496K 12K 0K 496K
3670036 more 324K 12K 0K 324K
6160532 cat 200K 12K 0K 200K
2621444 svmon 1.19M 88K 0K 1.19MBut, maybe you would prefer "one command" - at least for an overview. It is one I like in a pinch. Code:
michael@x054:[/home/michael]svmon -P -O segment=category,unit=auto
Unit: auto
-------------------------------------------------------------------------------
Pid Command Inuse Pin Pgsp Virtual
5177436 sshd 72.0M 33.2M 0K 71.4M
...............................................................................
SYSTEM segments Inuse Pin Pgsp Virtual
34.8M 33.2M 0K 34.8M
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
20002 0 work kernel segment s 34.8M 33.2M 0K 34.8M
...............................................................................
EXCLUSIVE segments Inuse Pin Pgsp Virtual
620K 12K 0K 620K
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
8e0d6e 2 work process private s 420K 12K 0K 420K
parent=8f0d0f
900cd0 f work shared library data s 200K 0K 0K 200K
parent=9f0d7f
860ce6 3 mmap maps 2 source(s) s 0K 0K - -
...............................................................................
SHARED segments Inuse Pin Pgsp Virtual
36.6M 0K 0K 36.0M
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
b000b d work shared library text s 36.0M 0K 0K 36.0M
890589 1 clnt code,/dev/hd2:194838 s 640K 0K - -
850aa5 - clnt /dev/hd2:91517 s 8K 0K - -
9b005b - clnt /dev/hd2:91283 s 8K 0K - -
-------------------------------------------------------------------------------
Pid Command Inuse Pin Pgsp Virtual
5570748 ksh 71.6M 33.2M 0K 71.3M
...............................................................................
SYSTEM segments Inuse Pin Pgsp Virtual
34.8M 33.2M 0K 34.8M
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
20002 0 work kernel segment s 34.8M 33.2M 0K 34.8M
...............................................................................
EXCLUSIVE segments Inuse Pin Pgsp Virtual
588K 12K 0K 588K
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
840d04 2 work process private s 464K 12K 0K 464K
9d0d9d f work shared library data s 124K 0K 0K 124K
...............................................................................
SHARED segments Inuse Pin Pgsp Virtual
36.3M 0K 0K 36.0M
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
b000b d work shared library text s 36.0M 0K 0K 36.0M
8600c6 1 clnt code,/dev/hd2:877 s 276K 0K - -
880ce8 - clnt /dev/hd1:4117 s 12K 0K - -
840104 - clnt /dev/hd2:91469 s 8K 0K - -
-------------------------------------------------------------------------------
Pid Command Inuse Pin Pgsp Virtual
5898474 ksh 71.6M 33.2M 0K 71.3M
...............................................................................
SYSTEM segments Inuse Pin Pgsp Virtual
34.8M 33.2M 0K 34.8M
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
20002 0 work kernel segment s 34.8M 33.2M 0K 34.8M
...............................................................................
EXCLUSIVE segments Inuse Pin Pgsp Virtual
576K 12K 0K 576K
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
960d76 2 work process private s 452K 12K 0K 452K
810cc1 f work shared library data s 124K 0K 0K 124K
...............................................................................
SHARED segments Inuse Pin Pgsp Virtual
36.3M 0K 0K 36.0M
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
b000b d work shared library text s 36.0M 0K 0K 36.0M
8600c6 1 clnt code,/dev/hd2:877 s 276K 0K - -
880ce8 - clnt /dev/hd1:4117 s 12K 0K - -
840104 - clnt /dev/hd2:91469 s 8K 0K - -
-------------------------------------------------------------------------------
Pid Command Inuse Pin Pgsp Virtual
3080218 ksh 71.6M 33.2M 0K 71.3M
...............................................................................
SYSTEM segments Inuse Pin Pgsp Virtual
34.8M 33.2M 0K 34.8M
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
20002 0 work kernel segment s 34.8M 33.2M 0K 34.8M
...............................................................................
EXCLUSIVE segments Inuse Pin Pgsp Virtual
576K 12K 0K 576K
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
9d0d7d 2 work process private s 452K 12K 0K 452K
800da0 f work shared library data s 124K 0K 0K 124K
...............................................................................
SHARED segments Inuse Pin Pgsp Virtual
36.3M 0K 0K 36.0M
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
b000b d work shared library text s 36.0M 0K 0K 36.0M
8600c6 1 clnt code,/dev/hd2:877 s 276K 0K - -
880ce8 - clnt /dev/hd1:4117 s 12K 0K - -
840104 - clnt /dev/hd2:91469 s 8K 0K - -
-------------------------------------------------------------------------------
Pid Command Inuse Pin Pgsp Virtual
2621654 svmon 50.1M 33.2M 0K 49.8M
...............................................................................
SYSTEM segments Inuse Pin Pgsp Virtual
45.3M 33.2M 0K 45.3M
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
20002 0 work kernel segment s 34.8M 33.2M 0K 34.8M
50005 9ffffffd work shared library s 10.5M 0K 0K 10.5M
f000f 9ffffffe work shared library s 44K 0K 0K 44K
9c0ddc 8fffffff work private load data s 20K 0K 0K 20K
...............................................................................
EXCLUSIVE segments Inuse Pin Pgsp Virtual
1.46M 88K 0K 1.19M
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
820d42 11 work text data BSS heap s 872K 0K 0K 872K
830c63 10 clnt text data BSS heap, s 240K 0K - -
/dev/hd2:507
990d59 9001000a work shared library data s 160K 0K 0K 160K
830da3 f00000002 work process private s 120K 88K 0K 120K
950d55 80020014 work USLA heap s 60K 0K 0K 60K
9a0c7a - clnt /dev/hd2:91888 s 32K 0K - -
940db4 ffffffff work application stack s 8K 0K 0K 8K
...............................................................................
SHARED segments Inuse Pin Pgsp Virtual
3.31M 0K 0K 3.25M
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
910011 90000000 work shared library text s 2.80M 0K 0K 2.80M
930013 90020014 work shared library s 464K 0K 0K 464K
820022 9fffffff clnt USLA text,/dev/hd2:8230 s 60K 0K - -
michael@x054:[/home/michael] |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| awk command to replace ";" with "|" and ""|" at diferent places in line of file | shis100 | Shell Programming and Scripting | 7 | 03-16-2011 08:59 AM |
| AIX 5.3 - Discrepancies between "top" and "vmstat" | troym72 | AIX | 1 | 11-26-2009 12:33 AM |
| HowTo: reg expr doing grep "timestamp>$DesiredTime" logfile ? | Browser_ice | Shell Programming and Scripting | 5 | 07-05-2009 02:17 PM |
| "too big" and "not enough memory" errors in shell script | jerardfjay | AIX | 11 | 03-16-2009 11:09 PM |
| "Out of Memory" after reboot for only Tuxedo DB servers on AIX 5.3 | swvahokie | AIX | 3 | 05-12-2008 11:46 AM |
|
|