How to use OS commands to diagnose Database Performance issues

$ man vmstat

Here is some sample output from these commands:

$ prtconf |grep -i "Memory size"

Memory size: 4096 Megabytes

$ swap -s
total: 7443040k bytes allocated + 997240k reserved = 8440280k used, 2777096k available

$ df -k

...

$ top



$ vmstat 5 100



$ iostat -c 2 100



$ iostat -D 2 100



$ mpstat 2 100



HP-UX 11.0:
============

$ grep Physical /var/adm/syslog/syslog.log
$ df -k
$ sar -w 2 100
$ sar -u 2 100
$ /bin/top
$ vmstat -n 5 100
$ iostat 2 100
$ top


For example:

$ grep Physical /var/adm/syslog/syslog.log
Nov 13 17:43:28 rmtdchp5 vmunix: Physical: 16777216 Kbytes, lockable: 13405388 Kbytes, available: 15381944 Kbytes

$ sar -w 1 100

HP-UX rmtdchp5 B.11.00 A 9000/800 12/20/02



$ sar -u 2 100 # This command generates CPU % usage information.

HP-UX rmtdchp5 B.11.00 A 9000/800 12/20/02


$ iostat 2 100



AIX:
=======

$ /usr/sbin/lsattr -E -l sys0 -a realmem
$ /usr/sbin/lsps -s
$ vmstat 5 100
$ iostat 2 100
$ /usr/local/bin/top # May not be installed by default in the server



For example:

$ /usr/sbin/lsattr -E -l sys0 -a realmem

realmem 33554432 Amount of usable physical memory in Kbytes False

NOTE: This is the total Physical + Swap memory in the system.
Use top or monitor command to get better breakup of the memory.



$ /usr/sbin/lsps -s

Total Paging Space Percent Used
30528MB 1%



Linux [RedHat 7.1 and RedHat AS 2.1]:
=======================================

$ dmesg | grep Memory
$ vmstat 5 100
$ /usr/bin/top

For example:

$ dmesg | grep Memory
Memory: 1027812k/1048568k available (1500k kernel code, 20372k reserved, 103k d)$ /sbin/swapon -s


Tru64:
========
$ vmstat -P| grep -i "Total Physical Memory ="
$ /sbin/swapon -s
$ vmstat 5 100



For example:

$ vmstat -P| grep -i "Total Physical Memory ="

Total Physical Memory = 8192.00 M


$ /sbin/swapon -s

Swap partition /dev/disk/dsk1g (default swap):

1 comment:

Santosh said...

Best Linux command Examples ever seen. Thanks for sharing with us.