vmstat command is used to monitor the memory and cpu utilization. Output contains the following details on a Unix server.
r (runqueue) The runqueue value shows the number of tasks executing and waiting for CPU resources. When this number exceeds the number of CPUs on the server, a CPU bottleneck exists, and some tasks are waiting for execution.
pi (page in) A page-in operation occurs when the server is experiencing a shortage of RAM memory. Any nonzero value for pi indicates excessive activity as RAM memory contents are read in from the swap disk.
us (user CPU) This is the amount of CPU that is servicing user tasks.
sy (system CPU) This is the percentage of CPU being used to service system tasks.
id (idle) This is the percentage of CPU that is idle.
wa (wait—IBM-AIX only) This shows the percentage of CPU that is waiting on external operations such as disk I/O.
Note that all of the CPU metrics are expressed as percentages. Hence, all of the CPU values (us + sy + id + wa) will always sum to 100. Now that we have a high-level understanding of the important vmstat data, let's look into some methods for using vmstat to identify server problems.Identifying CPU Bottlenecks with vmstatWaiting CPU resources can be shown in UNIX vmstat command output as the second column under the kthr (kernel thread state change) heading. Tasks may be placed in the wait queue (b) if they are waiting on a resource, while other tasks appear in the run queue (r) column. In short, the server is experiencing a CPU bottleneck when r is greater than the number of CPUs on the server. To see the number of CPUs on the server, you can use one of the following UNIX commands.
Display the Number of CPUs in IBM AIX and HP/UX
In AIX and HP/UX the lsdev command can be used to see the number of CPUs on a server. This is very important, because it shows the number of Parallel Query processes that can be used on that server. That, in turn, limits the value that you can use following the DEGREE keyword in a Parallel Query or DML statement.
lsdev -C grep ProcessDisplay Number of CPUs in Solaris
In Solaris, the prsinfo command can be used to count the number of CPUs on the processor.
psrinfo -v grep "Status of processor"Display Number of CPUs in Linux
To see the number of CPUs on a Linux server, you can cat the /proc/cpuinfo file.
cat /proc/cpuinfo grep processorRemember that we need to know the number of CPUs on our server because the vmstat runqueue value must never exceed the number of CPUs. A runqueue value of 32 is perfectly acceptable for a 36-CPU server, while a value of 32 would be a serious problem for a 24-CPU server.
http://www.dba-oracle.com/t_tuning_vmstat.htm
No comments:
Post a Comment