working with percent
[root@aix-oracle]/root# ps -efo user,pid,args,pcpu,pmem USER PID COMMAND %CPU %MEM root 1 /etc/init 0.0 0.0 root 4522448 /usr/sbin/syncd 60 0.0 0.0 root 4587958 /usr/ccs/bin/shlap64 0.0 0.0 oracle 6422992 ora_diag_ldb1 5.0 10.0
[root@aix-oracle]/root# ps -efo wpar,user,pid,ppid,vsz,comm,args,ruser WPAR USER PID PPID VSZ COMMAND COMMAND RUSER Global root 1 0 796 init /etc/init root Global root 4522448 1 604 syncd /usr/sbin/syncd 60 root WPAR1 root 4587958 1 396 shlap64 /usr/ccs/bin/shlap64 root WPAR2 oracle 6422992 1 9580 oracle ora_diag_ldb1 ldb1
Find the 10 biggest memory consuming processes (in kb)
[root@aix-oracle]/root# ps -efo user,pid,ppid,vsz,comm | sort -k4,n | tail -10 db1proj 29557414 1 187024 java root 63242864 1 192848 java oracle 28050030 1 197904 oracle db4proj 28508710 1 202192 java db5proj 35193482 1 202960 java db6supg 65471198 1 256536 java db7vupg 11273148 1 259480 java db8kupg 64881406 1 265880 java db22iupg 30212530 1 269336 java db56upg 58589736 1 274136 java
ps -efl : ps in long format
More common
[root@aix-oracle]/root# ps aux USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND oracle 37814872 0.5 0.0 299324 251948 - A 11:22:46 1:47 oracleapexd (L root 1114406 0.1 0.0 448 448 - A Oct 23 145:36 wait root 1048868 0.1 0.0 448 448 - A Oct 23 145:09 wait root 983330 0.1 0.0 448 448 - A Oct 23 135:59 wait oracle 18481408 0.1 0.0 256252 208876 - A 11:08:51 0:58 ora_db002 root 1376558 0.1 0.0 448 448 - A Oct 23 55:44 wait root 1311020 0.1 0.0 448 448 - A Oct 23 55:41 wait root 1245482 0.1 0.0 448 448 - A Oct 23 53:38 wait oracle 27198094 0.0 0.0 256060 208684 - A 11:02:02 0:15 ora_db001 root 131336 0.0 0.0 832 832 - A Oct 23 23:08 lrud oracle 29033350 0.0 0.0 57464 57320 pts/7 A 17:37:39 5:42 topas -P
pstree like
[root@aix-oracle]/root# ps -f -T 5308894 UID PID PPID C STIME TTY TIME CMD root 5308894 5243304 0 Oct 17 - 0:02 /usr/sbin/sshd root 10813830 5308894 0 11:21:21 - 0:00 |\--sshd: root@pts/1 root 21692682 10813830 1 11:21:22 pts/1 0:00 | \---ksh93 root 22151664 21692682 8 11:55:00 pts/1 0:00 | \--ps -f -T 5308894 root 23265582 5308894 0 10:08:43 - 0:00 |\--sshd: user01 [priv] user01 20119826 23265582 0 10:08:44 - 0:00 | \--sshd: user01@notty user01 12517808 20119826 0 10:08:44 - 0:00 | \--/usr/sbin/sftp-server -m /etc/ssh/sshd_config root 23396632 5308894 0 10:08:35 - 0:00 \--sshd: user01 [priv] user01 14942662 23396632 0 10:08:43 - 0:00 \--sshd: user01@pts/0 user01 21299502 14942662 0 10:08:44 pts/0 0:00 \---bash user01 15532456 21299502 0 10:08:46 pts/0 0:00 \--sudo su - root 15335842 15532456 0 10:08:48 pts/0 0:00 \---ksh93
Displaying top CPU_consuming processes:
# ps aux | head -1; ps aux | sort -rn +2
Displaying top memory-consuming processes:
# ps aux | head -1; ps aux | sort -rn +3 | head
Displaying process in order of priority:
# ps -eakl | sort -n +6 | head
Displaying the process in order of time:
# ps vx | head -1;ps vx | grep -v PID | sort -rn +3
Displaying the process in order of real memory use:
# ps vx | head -1; ps vx | grep -v PID | sort -rn +6
7. Displaying the process in order of I/O:
# ps vx | head -1; ps vx | grep -v PID | sort -rn +4
Command to display top ten processes and users:
# svmon -P -v -t 10 | more
Statistics about memory; virtual and real
[root@aix-oracle]/root# svmon -G -O unit=GB Unit: GB -------------------------------------------------------------------------------------- size inuse free pin virtual available mmode memory 64.0 63.9 0.05 9.64 73.6 2.32 Ded pg space 39.0 18.4 work pers clnt other pin 7.72 0 0.01 1.91 in use 59.6 0 4.35
Statistics about each process in MB
[root@aix-oracle]/root# svmon -P -O summary=basic,unit=MB Unit: MB ------------------------------------------------------------------------------- Pid Command Inuse Pin Pgsp Virtual 16974124 oracle 4571.70 42.3 10.2 4613.48 18940390 oracle 4566.95 42.3 10.2 4608.73 17891674 oracle 4556.23 42.3 10.2 4600.86 20185546 oracle 4555.60 42.3 10.2 4600.23 17367340 oracle 4555.60 42.3 10.2 4600.23 11141500 oracle 4553.41 42.3 10.2 4597.86 18481408 oracle 2771.19 42.3 477.39 1533.79 16318752 oracle 2476.04 42.3 10.2 2514.04 15532416 oracle 2473.96 42.3 10.2 2510.86 12517826 oracle 2464.07 42.3 10.2 2504.67 18612590 oracle 2462.45 42.3 10.2 2506.29 11272478 oracle 2462.29 42.3 10.2 2501.79
Get top 15 processes using high swap space.
[root@aix-oracle]/root# svmon -Pt15 | perl -e 'while(<>) {print if($.==2||$&&&!$s++);$.=0 if(/^-+$/)}' ------------------------------------------------------------------------------- Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd 16MB 42992164 oracle 773816 12661 157091 366470 Y N N 43123240 oracle 746443 12661 155970 364566 Y N N 42337408 oracle 745113 12661 156434 365206 Y N N 61931826 oracle 744693 12661 288207 544994 Y N N 52036314 oracle 743936 12661 286976 543810 Y N N 10683232 oracle 743410 12661 156818 365334 Y N N 14418820 oracle 743137 12661 156114 365190 Y N N
Real memory assign to the partition
[root@aix-oracle]/root# lparstat -i |egrep -i "Online|Maximum" |grep -i Memory Online Memory : 65536 MB Maximum Memory : 73728 MB
Real memory from aix side
[root@aix-oracle]/root# bootinfo -r 67108864
Swap memory from aix side
[root@aix-oracle]/root# lsps -a Page Space Physical Volume Volume Group Size %Used Active Auto Type Chksum hd62 hdisk1 rootvg 13312MB 47 yes yes lv 0 hd61 hdisk1 rootvg 13312MB 47 yes yes lv 0 hd6 hdisk1 rootvg 13312MB 47 yes yes lv 0
As now fully integrated to AIX, we use NMON instad of topas (use h for help,c cpu,m memory…)
[root@aix-oracle]/root# nmon lqtopas_nmonqqS=WLMsubclassesqqqqHost=oracle-aix232qqRefresh=2 secsqqq12:10.29qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x Memory qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqx x Physical PageSpace | pages/sec In Out | FileSystemCache x% Used 92.4% 1.1% | to Paging Space 0.0 0.0 | (numperm) 65.5% x% Free 7.6% 98.9% | to File System 1.5 0.0 | Process 9.1% xMB Used 7568.3MB 11.6MB | Page Scans 0.0 | System 17.8% xMB Free 623.7MB 1012.4MB | Page Cycles 0.0 | Free 7.6% xTotal(MB) 8192.0MB 1024.0MB | Page Steals 0.0 | ------ x | Page Faults 525.5 | Total 100.0% x x------------------------------------------------------------ | numclient 65.5% xMin/Maxperm 236MB( 3%) 7092MB( 90%) <--% of RAM | maxclient 90.0% xMin/Maxfree 960 1088 Total Virtual 9.0GB | User 71.3% xMin/Maxpgahead 2 8 Accessed Virtual 2.1GB 23.1%| Pinned 22.4% x | lruable pages 2017328.0 x x Top-Processes-(151) qqqqqMode=3 [1=Basic 2=CPU 3=Perf 4=Size 5=I/O 6=Cmds] qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqx x PID %CPU Size Res Res Res Char RAM Paging Command x x Used KB Set Text Data I/O Use io other repage x27329004 0.2 10900 10956 84 10872 0 0% 0 150 0 perl x19923454 0.1 10408 10160 372 9788 1 0% 0 77 0 topas_nmon x 7274808 0.0 720 744 88 656 0 0% 0 0 0 getty x 0 0.0 384 384 0 384 0 0% 0 0 0 Swapper x 2097476 0.0 960 960 0 960 0 0% 0 0 0 gil = TCP/IP x 4718958 0.0 4864 4864 0 4864 0 0% 0 0 0 nfsd x13238756 0.0 2132 4440 3136 1304 3 0% 0 0 0 sshd x 5505456 0.0 2016 17268 15780 1488 0 0% 0 0 0 aso x 5898680 0.0 1868 1556 324 1232 0 0% 0 0 0 pcmsrv x 7340516 0.0 1216 1216 0 1216 0 0% 0 0 0 rpc.lockd x 5439920 0.0 864 936 324 612 0 0% 0 0 0 xntpd x16646480 0.0 1172 996 808 188 0 0% 0 0 0 httpd x 459026 0.0 640 640 0 640 0 0% 0 0 0 reaffin x 7471596 0.0 13816 14692 1700 12992 0 0% 0 0 0 rmcd x29688080 0.0 984 1020 120 900 0 0% 0 0 0 vmstat x15925646 0.0 15400 15456 84 15372 0 0% 0 0 0 perl x 2031938 0.0 448 448 0 448 0 0% 0 0 0 netm x 655640 0.0 1088 1088 0 1088 0 0% 0 0 0 vtiol x 2883932 0.0 0 0 0 0 0 0% 0 0 0 <defunct Zombie>