excel跨工作表excel数据有效性引用怎么设置和引用

Power系统优化和监控最佳实践 v3_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
Power系统优化和监控最佳实践 v3
上传于||文档简介
&&P​o​w​e​r​系​统​优​化​和​监​控​最​佳​实​践​ ​v​3
阅读已结束,如果下载本文需要使用1下载券
想免费下载本文?
定制HR最喜欢的简历
下载文档到电脑,查找使用更方便
还剩67页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢博客访问: 136366
博文数量: 27
博客积分: 3010
博客等级: 中校
技术积分: 250
注册时间:
APP发帖 享双倍积分
IT168企业级官微
微信号:IT168qiye
系统架构师大会
微信号:SACC2013
CPU 性能监视
处理单元是系统中最快的组件之一。在某一时间对单个程序来说保持 100% 的 CPU 占用率(也就是说,空闲 0%,等待 0%)超过几秒钟是相对少见的。甚至在重负载的多用户系统中,偶尔会出现一些 10 毫秒(ms)的时间段,在其结束时所有线程处于等待状态。如果监视器长时间地显示 CPU 占用率为 100%,则很有可能是某个程序陷入了死循环。即使程序“仅仅”是占用较多资源而不是崩溃了,也需要将它识别出来并进行处理。
vmstat 命令(CPU)
第一个要使用的工具是 vmstat 命令,该命令可迅速提供关于各种系统资源和与之相关的性能问题的简要信息。vmstat 命令报告关于内核线程的统计信息,包括处于运行和等待队列中的、内存中的、页面调度中的、磁盘中的、中断、系统调用、上下文切换和 CPU 活动的内核线程。所报告的 CPU 活动是用户方式、系统方式、空闲时间和等待磁盘 I/O 的百分比细目分类。
如果使用 vmstat 命令时不带任何选项,或者只带有间隔时间和任意的计数参数,例如 vmstat 2 10;那么第一行数字为自系统重新引导以来的平均值。
作为一个 CPU 监视器,vmstat 命令优于 iostat 命令,因为 vmstat 命令是滚动的,使得它的每报告一行的输出更容易扫描,并且如果有很多磁盘连接到系统中,由此所涉及的开销更少。下面的示例可以帮助您识别一个程序失控时或 CPU 过度密集以至于不能在一个多用户环境中运行时的情况。# vmstat 2
----- ----------- ------------------------ ------------ -----------
903 239 77 23
977 216 72 28
此输出显示了在一个死循环中将程序引入到一个繁忙的多用户系统中所带来的效果。头三个报告(已删除摘要)表明系统平衡在 50-55% 的用户、30-35% 的系统和 10-15% 的 I/O 等待处。当循环程序开始运行,所有可用的 CPU 周期都被耗用。因为循环程序不进行 I/O,所以它可以占有前面因为 I/O 等待而未用过的所有周期。更糟的是,这代表当一个有用进程放弃 CPU 时,始终有一个进程准备接管 CPU。因为循环程序的优先级与所有其他前台进程一样,所以当另一个进程变得可分派时它也没必要一定得放弃 CPU。该程序运行大约 10 秒钟(五个报告),然后由 vmstat 命令报告的活动恢复到较正常的模式。
最佳利用是让 CPU 在 100% 的时间中工作。这适用于单用户系统的情况,不需要共享 CPU。总的来说,如果 us + sy 时间低于 90%,则不认为单用户系统是 CPU 受限制的。但是,如果在一个多用户系统中 us + sy 时间超过 80%,则进程可能要花时间在运行队列中等待。响应时间和吞吐量会受损害。
要检查 CPU 是否是瓶颈,考虑 vmstat 报告中的四个 cpu 列和两个 kthr(内核线程)列。查看故障列也是值得的:
在该时间间隔内使用 CPU 时间的百分比细分。cpu 列如下:
us 列显示了用户方式下所花费 CPU 时间的百分比。UNIX& 进程可以在用户方式下执行,也可以在系统(内核)方式下执行。当在用户方式下时,进程在它自己的应用程序代码中执行,不需要内核资源来进行计算、管理内存或设置变量。
sy 列详述了 CPU 在系统方式下执行一个进程所花时间的百分比。这包括内核进程(kprocs)和其他需要访问内核资源的进程所消耗的 CPU 资源。如果一个进程需要内核资源,它必须执行一个系统调用,并由此切换到系统方式从而使该资源可用。例如,对一个文件的读或写操作需要内核资源来打开文件、寻找特定的位置,以及读或写数据,除非使用内存映射文件。
id 列显示了没有未决本地磁盘 I/O 时 CPU 空闲或等待的时间百分比。如果没有线程可以执行(运行队列为空),系统分派一个叫做 wait 的线程,也称为 idle kproc。在一个 SMP 系统中,每个处理器都有一个 wait 线程可分派。由 ps 命令(带有 -k 或 -g 0选项)生成的报告将它确定为 kproc 或 wait。如果 ps 报告显示这个线程的总计时间较高,这表明存在重要的时间段,其中没有其他线程准备在 CPU 上运行或等待执行。系统因此大部分时间空闲和等待新任务。
wa 列详细显示了暂挂本地磁盘 I/O 和 NFS 加载的磁盘的 CPU 空闲百分比。如果在 wait 运行时至少有一个未完成的磁盘 I/O,该时间就归为 I/O 等待时间。除非进程使用异常 I/O,否则对磁盘的 I/O 请求会导致调用的进程阻塞(或睡眠),直到请求完成为止。一旦进程的 I/O 请求完成,该进程就放入运行队列中。如果 I/O 很快完成,该进程可以使用更多的 CPU 时间。
超过 25% 的 wa 的值可以表示磁盘子系统可能没有被正确平衡,或者这也可能是磁盘密集工作负载的结果。
关于对 wa 进行的更改的信息,请参阅。
每秒钟在采样间隔时间上对各种队列中的内核线程数求得的平均值。kthr 列如下:
可运行的内核线程平均数,包括正在运行的线程和正在等待 CPU 的线程。如果这个数字大于 CPU 的数目,至少有一个线程要等待 CPU,等待 CPU 的线程越多,越有可能对性能产生影响。
每秒 VMM 等待队列中的内核线程平均数。这包括正在等待文件系统 I/O 的线程,或由于内存装入控制而暂挂的线程。
如果进程由于内存装入控制而暂挂,在 vmstat 报告中的阻塞列(b)表明线程数目增加,而不是运行队列数目增加。
对于 vmstat -I,是每秒等待原始设备 I/O 的线程数目。等待文件系统 I/O的线程不包括在这里。
关于进程控制的信息,如陷阱和中断率。故障列如下:
在某一时间间隔中观测到的每秒设备中断数。其他信息可在中找到。
在某一时间间隔中观测到的每秒系统调用次数。通过明确的系统调用,用户进程可以使用资源。这些调用指示内核执行调用线程的操作,并在内核和该进程之间交换数据。因为工作负载和应用程序变化很大,不同的调用执行不同的功能,所以不可能定义每秒钟有多少系统调用才算太多。但是通常来讲,在一个单处理器系统上当 sy 列增大到超过每秒钟 10000 个调用时,则要求进行进一步调查(在一个 SMP 系统上,这个数字为每个处理器每秒钟 10000 个调用)。一个原因可能是“轮询”子例程,像 select() 子例程。对这一列,建议进行一个基准评估,给出正常 sy 值的计数。
在某一时间间隔中观测到的每秒钟上下文切换次数。物理 CPU 资源细分为每个 10 毫秒的逻辑时间片。假设一个线程被调度运行,它将一直运行直到它的时间片用完、直到被抢先或直到它自愿放弃 CPU 控制权。当给予另一个线程 CPU 控制权时,必须保存前一个线程的上下文或工作环境,并且必须装入当前线程的上下文。操作系统有一个很有效的上下文切换过程,所以每次切换并不耗费资源。任何上下文切换的显著增加,如当 cs 比磁盘 I/O 和网络信息包速率高得多,都应进行进一步调查。
iostat 命令
iostat 命令是获得第一印象的最快方法,不论系统是否存在磁盘 I/O 约束的性能问题(参阅)。这个工具也报告 CPU 统计信息。
下面的示例显示了 iostat 命令输出的一部分。第一节显示了自从系统启动以来的统计信息摘要。# iostat -t 2 6
CPU 统计信息列(% user、% sys、% idle 和 % iowait)提供了 CPU 的使用故障。该信息也在 vmstat 命令输出的标号为 us、sy、id 和 wa 的各列中报告。要获得各值的更为详细的解释,请参阅。也请注意在中描述的对 %iowait 所做的更改。
sar 命令收集关于系统的统计数据。尽管可以用它来收集一些关于系统性能的有用数据,但 sar 命令会增加系统负载,如果采样频率较高就会加剧预先存在的性能问题。但与记帐包相比,sar 命令的干扰更小。系统维护了一系列系统活动计数器,用来记录各种活动并提供 sar 命令报告的数据。sar 命令不会导致这些计数器被更新或使用;不论 sar 命令是否运行这都会自动进行。根据指定给 sar 命令的采样速率和采样次数,它仅仅从这些计数器中提取数据并保存下来。
通过它的许多选项,sar 命令提供了排队、页面调度、TTY 和许多其他的统计信息。sar 命令的一个重要功能是它会报告系统级(所有处理器的综合)的 CPU 统计信息(对一些结果取平均值,以百分比表示,对其他求和),或者报告每个独立处理器的统计信息。所以这个命令在 SMP 系统上特别有用。
有三种情况可以使用 sar 命令:
实时采样和显示
要收集并立即显示系统统计报告,使用下列命令:# sar -u 2 5
AIX aixhost 2 5 00049FDF4C00
这一示例来自于一个单用户工作站,显示了 CPU 使用率。
显示以前捕获的数据
-o 和 -f 选项(对用户给定的数据文件中进行读写)允许您在两个独立步骤中将机器的行为可视化。在问题再现期间这些操作消耗很少的资源。通过传送文件您可以使用单独的一台机器来分析数据,因为收集的二进制文件保留了 sar 命令所需的所有数据。# sar -o /tmp/sar.out 2 5 > /dev/null
上面的命令在后台运行 sar 命令,以两秒的时间间隔收集 5 个区间的系统活动数据,并将(未格式化的)sar 数据存储在 /tmp/sar.out 文件中。对标准输出使用重定向可以避免屏幕输出。
下列命令从文件中提取 CPU 信息并将格式化的报告输出到标准输出中:# sar -f/tmp/sar.out
AIX aixhost 2 5 00049FDF4C00
捕获的二进制数据文件中保留了报告所需的所有信息。因此可以调查每个可能的 sar 报告。这也允许在一个单处理器系统上显示 SMP 系统的处理器特定的信息。
通过守护程序 cron 的系统活动记帐
sar 命令调用一个叫做 sadc 的进程来访问系统数据。构造两个 shell 脚本(/usr/lib/sa/sa1 和 /usr/lib/sa/sa2),用守护程序 cron 运行这两个脚本,以提供每天的统计信息和报告。在 /var/spool/cron/crontabs/adm crontab 文件中包含了(但注释掉了)样本节,以指定守护程序 cron 应该何时运行 shell 脚本。
下面几行显示了一个修改过的管理员用户的 crontab。只除去了数据收集的注释字符:#=================================================================
SYSTEM ACTIVITY REPORTS
8am-5pm activity reports every 20 mins during weekdays.
activity reports every an hour on Saturday and Sunday.
6pm-7am activity reports every an hour during weekdays.
Daily summary prepared at 18:05.
#=================================================================
0 8-17 * * 1-5 /usr/lib/sa/sa1 1200 3 &
0 * * * 0,6 /usr/lib/sa/sa1 &
0 18-7 * * 1-5 /usr/lib/sa/sa1 &
5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 3600 -ubcwyaqvm &
#=================================================================
以这种方式收集数据有助于表征在一段时期中系统的使用情况并确定使用高峰时间。
有用的 CPU 选项
sar 命令中与 CPU 相关的最有用选项有:
-P 选项报告指定处理器的每处理器统计信息。通过指定 ALL 关键字,可以报告每个单独的处理器统计信息和所有处理器的平均值。在指定要报告统计信息的标志中,只有 -a、-c、-m、-u 和 -w 这几个标志与 -P 标志一起使用才有意义的。
下面的示例显示了当一个 CPU 受限程序在 0 号处理器上运行时的每处理器统计信息:# sar -P ALL 2 3
AIX aixsmphost 2 5 00049FDF4D01
17:30:50 cpu
17:30:52 0
17:30:54 0
17:30:56 0
每节的最后一行在 cpu 一列中以一个短划线(-)开始,是所有处理器的平均值。只有当使用 -P ALL 选项时才会显示一个平均值(-)行。如果指定了处理器,这一行将被除去。最后一节标记了平均值而不是一个时间戳,保留了所有节中处理器特定行的平均值。
下列示例显示了此时 vmstat 的输出:# vmstat 2 5
----------- ------------------------ ------------ ------------
第一个有编号的行是系统启动以来的摘要。第二行反映了 sar 命令的启动,这些报告可通过第三行进行比较。vmstat 命令只能显示所有处理器的 CPU 平均利用率。这与 sar 命令的 CPU 利用率输出中的虚线(-)行相当。
该命令显示了 CPU 利用率。如果不指定其他标志,这就是缺省标志。它显示的信息与 vmstat 或 iostat 命令的 CPU 统计信息一样。
在下列示例中,启动了一个复制命令:# sar -u -P ALL 1 5
AIX aixsmphost 2 5 00049FDF4D01
13:33:42 cpu
cp 命令在 0 号处理器上工作,其他三个处理器空闲。有关更多信息,请参阅。
-c 选项显示了系统调用率。# sar -c 1 3
19:28:25 scall/s sread/s swrit/s
exec/s rchar/s wchar/s
0.00 2691306
0.00 2716922
0.00 2716922
0.00 2708329
虽然 vmstat 命令也显示系统调用率,如果这些系统调用是 read()、write()、fork()、exec() 和其他调用,sar 命令也可以显示它们。请特别注意 fork/s 一列。如果它较高,则可能需要使用记帐实用程序(如 trace 命令或 tprof 命令)进行进一步调查。
-q 选项显示了运行队列长度和交换队列长度。# sar -q 5 3
19:31:42 runq-sz %runocc swpq-sz %swpocc
每秒钟可运行的平均线程数和运行队列被占用的时间百分比(% 字段容易出错)。
VMM 等待队列中的平均线程数和交换队列被占用的时间百分比。(% 字段容易出错。)
-q 选项可以指出您系统中是否运行太多的作业(runq-sz),或有一个潜在的页面调度瓶颈。在一个高度事务性的系统中,例如企业资源规划(ERP),运行队列可能有几百个,因为每项事务只使用少量的 CPU 时间。如果页面调度是问题所在,则运行 vmstat 命令。高的 I/O 等待表明存在严重的磁盘争用活动,或由于内存不足而产生过多的页面调度。
阅读(7544) | 评论(1) | 转发(0) |
相关热门文章
给主人留下些什么吧!~~
现在的監視器不需要怎么麻烦了、而且还可以电子……/
请登录后评论。很抱歉,该文档已经被删除了...先到其它地方遛一圈吧!
您可以在豆丁搜索您要找的内容
您可能感兴趣的文档
&2008- Inc. All Rights Reserved 豆丁网
扫描下载APP
扫描关注豆丁网
微信号:doudingwang
随时赢取精美礼品本溪人才网
本溪人才网
本溪人才在线求职招聘,企业人力资源平台
本溪人才网下次自动登录
现在的位置:
& 综合 & 正文
Oracle日常维护时需要用到的各种unix操作系统命令
############################################
SECTION 1. COMMANDS TO RETREIVE SYSTEMINFO:
############################################
==========================
1. HOW TO GET SYSTEM INFO:
==========================
1.1 Short version:
==================
See section 1.2 for more detailed commandsand options.
AIX: bootinfo -r
lsattr -E -lmem0
/usr/sbin/lsattr -E -l sys0 -a realmem
or use a tool as "topas" or"nmon" (these are utilities)
Linux: cat /proc/meminfo
/usr/sbin/dmesg | grep "Physical"
free (the free command)
HP: /usr/sam/lbin/getmem
grep MemTotal /proc/meminfo
/etc/dmesg | grep -i phys
wc -c /dev/mem
or us a tool as "glance", likeentering "glance -m" from prompt (is a utility)
Solaris: /usr/sbin/prtconf | grep"Memory size"
Tru64: /bin/vmstat -P | grep "TotalPhysical Memory"
AIX: /usr/sbin/lsps -a
HP: /usr/sbin/swapinfo -a
Solaris: /usr/sbin/swap -l
Linux: /sbin/swapon -s
cat /proc/swaps
cat /proc/meminfo
OS version:
-----------
HP: uname -a
Linux: cat /proc/version
Solaris: uname -a
cat /etc/release (or other way to view thatfile, like "more /etc/release")
Tru64: /usr/sbin/sizer -v
AIX: oslevel -r
lslpp -h bos.rte
AIX firmware:
lsmcode -c display the system firmwarelevel and service processor
lsmcode -r -d scraid0 display the adaptermicrocode levels for a RAID adapter scraid0
lsmcode -A display the microcode level forall supported devices
prtconf shows many setting includingmemory, firmware, serial# etc..
HP: ioscan -kfnC processor
getconf CPU_VERSION
getconf CPU_CHIP_TYPE
AIX: prtconf | grep proc
pmcycles -m
lsattr -El procx (x is 0,2, etc..)
lscfg | grep proc
Linux: cat /proc/cpuinfo
Solaris: psrinfo -v
Notes about lpars:
-----------------For
AIX: The uname -L command identifies apartition on a system with multiple
LPARS. The LPAR id
can be useful for writing shell scriptsthat customize system settings such as IP
address or hostname.
The output of the command looks like:
# uname -L
The output of uname -L varies bymaintenance level. For consistent output across
maintenance levels,
add a -s flag. For illustrate, thefollowing command assigns the partition number
to the variable
"lpar_number" and partiton nameto "lpar_name".
For HP-UX:
Use commands like "parstatus" or"getconf PARTITION_IDENT" to get npar information.
AIX: Is a certain fix (APAR) installed?
instfix -ik APAR_number
instfix -a -ivk APAR_number
To determine your platform firmware level,at the command prompt, type:
lscfg -vp | grep -p Platform
The last six digits of the ROM levelrepresent the platform firmware date in
the format, YYMMDD.
HP: /usr/sbin/swlist -l patch
swlist | grep patch
Linux: rpm -qa
Solaris: showrev -p
pkginfo -i package_name
Tru64: /usr/sbin/dupatch -track -type kit
AIX: lsdev -Cc adapter
lsdev -Cc adapter | grep ent
lsdev -Cc if
lsattr -E -l ent1
ifconfig -a
Solaris: prtconf -D / prtconf -pv / prtconf| grep "card"
prtdiag | grep "card"
ifconfig -a (up plumb)
.2 More Detail: 1=============== =
.2.1 Show memory in Solaris:
============================
Use this command to obtain detailed systeminformation about your Sun Solaris
installation
#/usr/sbin/prtconf
prtconf -v#
Displays the size of the system memory andreports information about peripheral devices
se this command to see the amount ofmemory:
/usr/sbin/prtconf | grep "Mem"
sysdef -i reports on several systemresource limits. Other parameters can be checked
n a running system
sing adb -k :
adb -k /dev/ksyms /dev/mem
parameter-name/D
D (to exit)^
.2.2 Show memory inAIX:1======================== =
& Show Total memory: &
-------=====--------
bootinfo -r #
lsattr -El sys0 -a realmem
(you can grep it on memory)prtconf
& Show Details of memory: &
You can have a more detailed andcomprehensive look at AIX memory by using "vmstat
v" and "vmo -L" or "vmo-a":
or example:
vmstat -v#
524288 memory pages
493252 lruable pages
67384 free pages
7 memory pools
131820 pinned pag
80.0 maxpin percentagees
20.0 minperm percentage
80.0 maxperm percentage
25.4 numperm percentage
125727 file pages
0.0 compressed percentage
0 compressed pages
25.4 numclient percentage
80.0 maxclient percentage
125575 client pages
0 remote pageouts scheduled
14557 pending disk I/Os blocked with nopbuf
6526890 paging space I/Os blocked with nopsbuf
18631 filesystem I/Os blocked with no fsbuf
0 client filesystem I/Os blocked with nofsbuf
49038 external pager filesystem I/Osblocked with no fsbuf
0 Virtualized Partition Memory Page Faults
0.00 Time resolving virtualized partitionmemory page faults
The vmo command really gives lots ofoutput. In the following example only a small
fraction of the output is shown:
lrubucket 128K 128K 128K 64K 4KB pages D
--------------------------------------------------------------------------------
maxclient% 80 80 80 1 100 % memory D
--------------------------------------------------------------------------------
maxfree 88 8 200K 4KB pages D
memory_frames
--------------------------------------------------------------------------------
maxperm 596 S
--------------------------------------------------------------------------------
maxperm% 80 80 80 1 100 % memory D
maxclient%
--------------------------------------------------------------------------------
maxpin 179 S
&& To further look at your virtualmemory and its causes, you can use a combination of:
---------------------------------------------------------------------------------------
# ipcs -bm (shared memory)
# lsps -a (paging)
# vmo -a or vmo -L (virtual memory options)
# svmon -G (basic memory allocations)
# svmon -U (virtual memory usage by user)
To print out the memory usage statisticsfor the users root and steve
taking into account only working segments,type:
svmon -U root steve -w
To print out the top 10 users of the pagingspace, type:
svmon -U -g -t 10
To print out the memory usage statisticsfor the user steve, including the
list of the process identifiers, type:
svmon -U steve -l
svmon -U emcdm -l
Note: sysdumpdev -e
Although the sysdumpdev command is used toshow or alter the dumpdevice for a system
you can also use it to show how much realmemory is used.
The command
# sysdumpdev -e
provides an estimated dump size taking intoaccount the current memory (not
pagingspace) currently
in use by the system.
Note: the rmss command:
The rmss (Reduced-Memory System Simulator)command is used to ascertain the effects
of reducing the amount
of available memory on a system without theneed to physically remove memory from the
system. It is useful
for system sizing, as you can install morememory than is required and then use rmss
to reduce it.
Using other performance tools, the effectsof the reduced memory can be monitored.
The rmss command has
the ability to run a command multiple timesusing different simulated memory sizes
and produce statistics
for all of those memory sizes.
The rmss command resides in /usr/bin and ispart of the bos.perf.tools fileset, which
is installable
from the AIX base installation media.
Syntax rmss -p -c &MB& -r
-p Print the current value
-c MB Change to M size (in Mbytes)
-r Restore all memory to use
-p Print the current value
Example: find out how much memory you haveonline
Example: Change available memory to 256Mbytes
rmss -c 256
Example: Undo the above
rmss can damage performance very seriously
Don't go below 25% of the machines memory
Never forget to finish with rmss -r
1.2.3 Show memory in Linux:
===========================
# /usr/sbin/dmesg | grep"Physical:"
# cat /proc/meminfo
The ipcs, vmstat, iostat and that type ofcommands, are ofcourse more or less the same
in Linux as they are in Solaris or AIX.
1.2.4 Show aioservers in AIX:
=============================
# lsattr -El aio0
autoconfig available STATE to be configuredat system restart True
fastpath enable State of fast path True
kprocprio 39 Server PRIORITY True
maxreqs 4096 Maximum number of REQUESTSTrue
maxservers 10 MAXIMUM number of servers percpu True
minservers 1 MINIMUM number of servers True
# pstat -a | grep -c aios
# ps -k | grep aioserver
:15 aioserver
:14 aioserver
:12 aioserver
:10 aioserver
:11 aioserver
:10 aioserver
:11 aioserver
:17 aioserver
:12 aioserver
:15 aioserver
:17 aioserver
:12 aioserver
:13 aioserver
:14 aioserver
:14 aioserver
:11 aioserver
:12 aioserver
:13 aioserver
:13 aioserver
:13 aioserver
What are aioservers in AIX5?:
With IO on filesystems, for example if adatabase is involved, you may try to tune
the number
of aioservers (asynchronous IO)
AIX 5L supports asynchronous I/O (AIO) fordatabase files created both on file system
partitions and on raw devices.
AIO on raw devices is implemented fullyinto the AIX kernel, and does not require
database processes
to service the AIO requests. When using AIOon file systems, the kernel database
processes (aioserver)
control each request from the time arequest is taken off the queue until it
completes. The kernel database
processes are also used with I/O withvirtual shared disks (VSDs) and HSDs with
FastPath disabled. By default,
FastPath is enabled. The number ofaioserver servers determines the number of AIO
requests that can be executed
in the system concurrently, so it isimportant to tune the number of aioserver
processes when using file systems
to store Oracle Database data files.
- Use one of the following commands to setthe number of servers. This applies only
when using asynchronous I/O
on file systems rather than raw devices:
# smit aio
# chdev -P -l aio0 -a maxservers='128' -aminservers='20'
- To set asynchronous IO to `Available':
# chdev -l aio0 -P -a autoconfig=available
You need to restart the Server:
# shutdown -Fr
1.2.5 aio on Linux distro's:
============================
On some Linux distro's, Oracle 9i/10gsupports asynchronous I/O but it is disabled by
default because
some Linux distributions do not have libaioby default. For Solaris, the following
configuration is not required
- skip down to the section on enablingasynchronous I/O.
On Linux, the Oracle binary needs to berelinked to enable asynchronous I/O. The
first thing to do is shutdown
the Oracle server. After Oracle hasshutdown, do the following steps to relink the
su - oracle
cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk async_on
make -f ins_rdbms.mk ioracle
1.2.6 The ipcs and ipcrm commands:
==================================
The "ipcs" command is really a"listing" command. But if you need to intervene
in memory structures, like for example ifyou need to "clear" or remove a shared
memory segment,
because a faulty or crashed
application left semaphores, memoryidentifiers, or queues in place,
you can use to "ipcrm" command toremove those structures.
Example ipcrm command usage:
Suppose an application crashed, but itcannot be started again. The following might
if you happened to know which IPCidentifier it used.
Suppose the app used 47500 as the IPC key.Calcultate this decimal number to hex
which is, in this example, B98C.
No do the following:
# ipcs -bm | grep B89C
This might give you, for example, theshared memory identifier "".
Now clear the segment:
# ipcrm -m
It might also be, that still a semaphoreand/or queue is still "left over".
In that case you might also try commandslike the following example:
# ipcrm -s 2228248 (remove semaphore)
# ipcrm -q 5111883 (remove queue)
Note: in some cases the"slibclean" command can be used to clear unused modules in
kernel and library memory.
Just give as root the command:
# slibclean
Other Example:
If you run the following command to removea shared memory segment and you get this
# ipcrm -m 65537
shmid(65537) was not found.
However, if you run the ipcs command, youstill see the segment there:
# ipcs | grep 65537
m 00000 DCrw------- root system
If you look carefully, you will notice the"D" in the forth column. The "D" means:
D If the associated shared memory segmenthas been removed. It disappears when the
last process attached
to the segment detaches it.
So, to clear the shared memory segment,find the process which is still associated
with the segment:
# ps -ef | grep process_owner
where process_owner is the name of theowner using the shared segment
Now kill the process found from the pscommand above
# kill -9 pid
Running another ipcs command will show theshared memory segment no longer exists:
# ipcs | grep 65537
ipcrm -m 65537
1.2.7 Show patches, version, systeminfo:
========================================
Displays system summary information.
#showrev -p
Reports which patches are installed
sysdef and dmesg:
-----------------
The follwing commands also displaysconfiguration information
==& To check your Solaris version:
# uname -a or uname -m
# cat /etc/release
# isainfo -v
==& To check your AIX version:
# oslevel -r tells you which maintenancelevel you have.
&& To find the known recommendedmaintenance levels:
# oslevel -rq
&& To find all filesets lower than acertain maintenance level:
# oslevel -rl 5200-06
&& To find all filesets higher than acertain maintenance level:
# oslevel -rg 5200-05
&& To list all known recommendedmaintenance and technology levels on the system, type:
# oslevel -q -s
Known Service Packs
-------------------
5300-04-CSP
5300-03-CSP
&& How can I determine which filesetupdates are missing from a particular AIX level?
To determine which fileset updates aremissing from 5300-04, for example, run the
following command:
# oslevel -rl 5300-04
&& What SP (Service Pack) isinstalled on my system?
To see which SP is currently installed onthe system, run the oslevel -s command.
Sample output for an
AIX 5L Version 5.3 system, with TL4, andSP2 installed would be:
# oslevel -s
&& Is a CSP (Concluding Service Pack)installed on my system?
To see if a CSP is currently installed onthe system, run the oslevel -s command.
Sample output for an AIX 5L Version 5.3system, with TL3, and CSP installed would be:
# oslevel -s
5300-03-CSP
==& To check your HP machine:
: machine info on AIX
How do I find out the Chip type, Systemname, Node name, Model Number etc.?
Displays the chipThe uname command providesdetails about your system. uname -p
type of the system.
For example, powerpc.
uname -r Displays the release number of theoperating system.
uname -s Displays the system name. Forexample, AIX.
uname -n Displays the name of the node.
uname -a Displays the system name,nodename,Version, Machine id.
uname -M Displays the system model name.For example, IBM, 7046-B50.
uname -v Displays the operating systemversion
uname -m Displays the machine ID number ofthe hardware running the system.
uname -u Displays the system ID number.
Architecture:
To see if you have a CHRP machine, log intothe machine as the root user, and run the
following command:
# lscfg | grep Architecture or use:
# lscfg -pl sysplanar0 | more
The bootinfo -p command also shows thearchitecture of the pSeries, RS/6000
# bootinfo -p
1.2.8 Check whether you have a 32 bit or 64 bit version:
========================================================
# iasinfo -vk
If /usr/bin/isainfo cannot be found, thenthe OS only
supports 32-bit process address spaces.(Solaris 7
was the first version that could run 64-bitbinaries
on certain SPARC-based systems.)
So a ksh-based test might look somethinglike
if [ -x /usr/bin/isainfo ]; then
bits=`/usr/bin/isainfo-b`
Command: ...to see if bos.64bit isinstalled &/bin/lslpp -l bos.64bit
committed.
-or-/bin/locale64 ...error message if on32bit machine such
Could not load program /bin/locale64:
Cannot run a 64-bit program on a
32-bit machine.
# bootinfo -K displays the current kernelwordsize of "32" or "64"
# bootinfo -y tells if hardware is 64-bitcapable
# bootinfo -p If it returns the string 32it is only capable of running the
32-bit kernel. If it returns the stringchrp the machine is
capable of running the 64-bit kernel or the32-bit kernel.
# /usr/bin/getconf HARDWARE_BITMODE
This command should return the followingoutput:
HOW TO CHANGE KERNEL MODE OF IBM AIX 5L(5.1)
--------------------------------------------The
AIX 5L has pre-configured kernels. Theseare listed below for Power
processors:
/usr/lib/boot/unix_up 32 bit uni-processor
/usr/lib/boot/unix_mp 32 bit multi-processorkernel
/usr/lib/boot/unix_64 64 bitmulti-processor kernel
Switching between kernel modes means usingdifferent kernels. This is simply
done by pointing the location that isreferenced by the system to these kernels.
Use symbolic links for this purpose. Duringboot AIX system runs the kernel
in the following locations:
/usr/lib/boot/unix
The base operating system 64-bit runtimefileset is bos.64bit. Installing bos.64bit
also installs
the /etc/methods/cfg64 file. The /etc/methods/cfg64file provides the option of
enabling or disabling
the 64-bit environment via SMIT, whichupdates the /etc/inittab file with the
load64bit line.
(Simply adding the load64bit line does notenable the 64-bit environment).
The command lslpp -l bos.64bit reveals ifthis fileset is installed. The bos.64bit
is on the AIX however, installingthe bos.64bit fileset does not ensure that
you will be able
to run 64-bit software. If the bos.64bitfileset is installed on 32-bit hardware,
you should be able
to compile 64-bit software, but you cannotrun 64-bit programs on 32-bit hardware.
The syscalls64 extension must be loaded inorder to run a 64-bit executable. This
is done from
the load64bit entry in the inittab file.You must load the syscalls64 extension
even when running
a 64-bit kernel on 64-bit hardware.
To determine if the 64-bit kernel extensionis loaded, at the command line, enter
genkex |grep 64.
Information similar to the followingdisplays:
149bf58 a3ec /usr/lib/drivers/syscalls64.ext
To change the kernel mode follow stepsbelow:
1. Create symbolic link from /unix and/usr/lib/boot/unix to the location
of the desired kernel.
2. Create boot image.
3. Reboot AIX.
Below lists the detailed actions to changekernel mode:
To change to 32 bit uni-processor mode:
# ln -sf /usr/lib/boot/unix_up /unix
# ln -sf /usr/lib/boot/unix_up/usr/lib/boot/unix
# bosboot -ad /dev/ipldevice
# shutdown -r
To change to 32 bit multi-processor mode:
# ln -sf /usr/lib/boot/unix_mp /unix
# ln -sf /usr/lib/boot/unix_mp/usr/lib/boot/unix
# bosboot -ad /dev/ipldevice
# shutdown -r
To change to 64 bit multi-processor mode:
# ln -sf /usr/lib/boot/unix_64 /unix
# ln -sf /usr/lib/boot/unix_64/usr/lib/boot/unix
# bosboot -ad /dev/ipldevice
# shutdown -r
IMPORTANT NOTE: If you are changing thekernel mode to 32-bit and you will run
9.2 on this server, the following lineshould be included in /etc/inittab:
load64bit:2:wait:/etc/methods/cfg64&/dev/console 2&&1 # Enable 64-bit execs
This allows 64-bit applications to run onthe 32-bit kernel. Note that this
line is also mandatory if you are using the64-bit kernel.
In AIX 5.2, the 32-bit kernel is installedby default. The 64-bit kernel, along with
(enhanced journaled file system), can beenabled at installation time.
Checking if other unixes are in 32 or 64mode:
-Digital UNIX/Tru64: This OS is onlyavailable in 64bit form.
- HP-UX(Available in 64bit starting withHP-UX 11.0):
Command: /bin/getconf KERNEL_BITS ...returnseither 32 or 64
-SGI: This OS is only available in 64bitform.
-The remaining supported UNIX platforms areonly available in 32bit form.
scinstall:
# scinstall -pv
Displays Sun Cluster software release andpackage version information
1.2.9 Info about CPUs:
======================
# psrinfo -v
Shows the number of processors and theirstatus.
# psrinfo -v|grep "Status ofprocessor"|wc -l
Shows number of cpu's
# cat /proc/cpuinfo
# cat /proc/cpuinfo | grep processor|wc -l
Especially with Linux, the /proc directorycontains special "files" that either
extract information from
or send information to the kernel
# ioscan -kfnCprocessor
#/usr/sbin/ioscan -kf | grep processor
# grep processor/var/adm/syslog/syslog.log
# /usr/contrib/bin/machinfo (Itanium)
Several ways as,
1. sam -& performance monitor -&processor
2. print_manifest (if ignite-ux installed)
3. machinfo (11.23 HP versions)
4. ioscan -fnC processor
5. echo "processor_count/D" | adb/stand/vmunix /dev/kmem
6. top command to get cpu count
The "getconf" command can giveyou a lot of interesting info. The parameters are:
ARG_MAX _BC_BASE_MAX BC_DIM_MAX
BS_SCALE_MAX BC_STRING_MAXCHARCLASS_NAME_MAX
CHAR_BIT CHAR_MAXCHAR_MIN
CHILD_MAX CLK_TCK COLL_WEIGHTS_MAX
CPU_CHIP_TYPE CS_MACHINE_IDENTCS_PARTITION_IDENT
CS_PATH CS_MACHINE_SERIAL EXPR_NEST_MAX
HW_CPU_SUPP_BITS HW_32_64_CAPABLE INT_MAX
INT_MINKERNEL_BITS LINE_MAX
LONG_BIT LONG_MAX LONG_MIN
MACHINE_IDENT MACHINE_MODEL MACHINE_SERIAL
MB_LEN_MAX NGROUPS_MAX NL_ARGMAX
NL_LANGMAX NL_MSGMAX NL_NMAX
NL_SETMAX NL_TEXTMAX NZERO
OPEN_MAX PARTITION_IDENT PATH
_POSIX_ARG_MAX _POSIX_JOB_CONTROL_POSIX_NGROUPS_MAX
_POSIX_OPEN_MAX _POSIX_SAVED_IDS_POSIX_SSIZE_MAX
_POSIX_STREAM_MAX _POSIX_TZNAME_MAX_POSIX_VERSION
POSIX_ARG_MAX POSIX_CHILD_MAXPOSIX_JOB_CONTROL
POSIX_LINK_MAX POSIX_MAX_CANONPOSIX_MAX_INPUT
POSIX_NAME_MAX POSIX_NGROUPS_MAXPOSIX_OPEN_MAX
POSIX_PATH_MAX POSIX_PIPE_BUFPOSIX_SAVED_IDS
POSIX_SSIZE_MAX POSIX_STREAM_MAX POSIX_TZNAME_MAX
POSIX_VERSION POSIX2_BC_BASE_MAXPOSIX2_BC_DIM_MAX
POSIX2_BC_SCALE_MAX POSIX2_BC_STRING_MAXPOSIX2_C_BIND
POSIX2_C_DEV POSIX2_C_VERSIONPOSIX2_CHAR_TERM
POSIX_CHILD_MAX POSIX2_COLL_WEIGHTS_MAXPOSIX2_EXPR_NEST_MAX
POSIX2_FORT_DEV POSIX2_FORT_RUNPOSIX2_LINE_MAX
POSIX2_LOCALEDEF POSIX2_RE_DUP_MAXPOSIX2_SW_DEV
POSIX2_UPE POSIX2_VERSION SC_PASS_MAX
SC_XOPEN_VERSION SCHAR_MAX SCHAR_MIN
SHRT_MAX SHRT_MIN SSIZE_MAX
# getconf CPU_VERSION
sample function in shell script:
get_cpu_version()
case `getconf CPU_VERSION` in
# ???) echo "Itanium[TM] 2" ;;
768) echo "Itanium[TM] 1" ;;
532) echo "PA-RISC 2.0" ;;
529) echo "PA-RISC 1.2" ;;
528) echo "PA-RISC 1.1" ;;
523) echo "PA-RISC 1.0" ;;
*) return 1 ;;
# pmcycles -m
Cpu 0 runs at 1656 MHz
Cpu 1 runs at 1656 MHz
Cpu 2 runs at 1656 MHz
Cpu 3 runs at 1656 MHz
# lscfg | grep proc
More cpu information on AIX:
# lsattr -El procx (where x is the numberof the cpu)
type powerPC_POWER5 Processor type False
Processor speed False
where False means that the value cannot bechanged through an AIX command.
To view CPU scheduler tunable parameters,use the schedo command:
# schedo -a
In AIX 5L on Power5, you can switch fromSimultaneous Multithreading SMT, or Single
Threading ST, as follows
# smtctl -m off will set SMT mode todisabled
# smtctl -m on will set SMT mode to enabled
# smtctl -W boot makes SMT effective onnext boot
# smtctl -W now effects SMT now, but will notpersist across reboots
When you want to keep the setting acrossreboots, you must use the bosboot command
in order to create a new boot image.
1.2.10 Other stuff:
===================
To show the init runlevel:
Top users:
To get a quick impression about the top 10users in the system at this time:
ps auxw | sort -r +3 |head -10 -Shows top10 memory usage by process
ps auxw | sort -r +2 |head -10 -Shows top10 CPU usage by process
shared memory:
To check shared memory segment, semaphorearray, and message queue limits, issue the
ipcs -l command.
The following tools are available formonitoring the performance of your UNIX-based
/usr/proc/bin/pfiles
This shows the open files for this process,which helps you diagnose whether you are
having problems
caused by files not getting closed.
This utility lists open files for runningUNIX processes, like pfiles. However, lsof
gives more
useful information than pfiles. You canfind lsof at
ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/.
Example of lsof usage:
You can see CIO (concurrent IO) in theFILE-FLAG column if you run lsof +fg, e.g.:
tarunx01:/home/abielewi:#/p570build/LSOF/lsof-4.76/usr/local/bin/lsof +fg
/baanprd/oradat
COMMAND PID USER FD TYPE FILE-FLAG DEVICE
SIZE/OFF NODE NAME
oracle 434222 oracle 16u VREGR,W,CIO,DSYN,LG;CX 39,1
/baanprd/oradat(/dev/bprdoradat)
oracle 434222 oracle 17u VREGR,W,CIO,DSYN,LG;CX 39,1
/baanprd/oradat(/dev/bprdoradat)
oracle 442384 oracle 15u VREGR,W,CIO,DSYN,LG;CX 39,1
875 /baanprd/oradat(/dev/bprdoradat)
oracle 442384 oracle 16u VREGR,W,CIO,DSYN,LG;CX 39,1
7 /baanprd/oradat(/dev/bprdoradat)
oracle 450814 oracle 15u VREGR,W,CIO,DSYN,LG;CX 39,1
875 /baanprd/oradat(/dev/bprdoradat)
oracle 450814 oracle 16u VREGR,W,CIO,DSYN,LG;CX 39,1
876 /baanprd/oradat(/dev/bprdoradat)
oracle 487666 oracle 15u VREGR,W,CIO,DSYN,LG;CX 39,1
875 /baanprd/oradat (/dev/bprdoradat
You should also see O_CIO in your file opencalls if you run truss,
open("/opt/oracle/rcat/oradat/redo01.log",
O_RDWR|O_CIO|O_DSYNC|O_LARGEFILE) = 18
VMSTAT SOLARIS:
This command is ideal for monitoring pagingrate, which can be found under the page
in (pi) and page out (po) columns.
Other important columns are the amount ofallocated virtual storage (avm) and free
virtual storage (fre).
This command is useful for determining ifsomething is suspended or just taking a
long time.
kthr memory page disk faults cpu
r b w swap free re mf pi po fr de sr m0 m1m3 m4 in sy cs us sy id
0 00 0 0 0 680
0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 00 402
0 0 0 1 0 0 0 0 0 0 00 0 48 10 5 85
0 0 0 0 0 0 0 00 505
0 0 0 0 0 0 0 00 817
30 0 0 0 0 0 0 00 473
procs/r: Run queue length.
procs/b: Processes blocked while waitingfor I/O.
procs/w: Idle processes which have beenswapped.
memory/swap: Free, unreserved swap space(Kb).
memory/free: Free memory (Kb). (Note thatthis will grow until it reaches lotsfree,
at which point
the page scanner is started. See"Paging" for more details.)
page/re: Pages reclaimed from the freelist. (If a page on the free list still
contains data needed
for a new request, it can be remapped.)
page/mf: Minor faults (page in memory, butnot mapped). (If the page is still in
memory, a minor fault
remaps the page. It is comparable to thevflts value reported by sar -p.)
page/pi: Paged in from swap (Kb/s). (When apage is brought back from the swap
device, the process
will stop execution and wait. This mayaffect performance.)
page/po: Paged out to swap (Kb/s). (Thepage has been written and freed. This can be
the result of
activity by the pageout scanner, a fileclose, or fsflush.)
page/fr: Freed or destroyed (Kb/s). (Thiscolumn reports the activity of the page
page/de: Freed after writes (Kb/s). (Thesepages have been freed due to a pageout.)
page/sr: Scan rate (pages). Note that thisnumber is not reported as a "rate," but as
a total number of pages scanned.
disk/s#: Disk activity for disk # (I/O'sper second).
faults/in: Interrupts (per second).
faults/sy: System calls (per second).
faults/cs: Context switches (per second).
cpu/us: User CPU time (%).
cpu/sy: Kernel CPU time (%).
cpu/id: Idle + I/O wait CPU time (%).
When analyzing vmstat output, there areseveral metrics to which you should pay
attention. For example,
keep an eye on the CPU run queue column.The run queue should never exceed the number
of CPUs on the server.
If you do notice the run queue exceedingthe amount of CPUs, it's a good indication
that your server
has a CPU bottleneck.
To get an idea of the RAM usage on yourserver, watch the page in (pi) and page out
(po) columns
of vmstat's output. By tracking commonvirtual memory operations such as page outs,
you can infer
the times that the Oracle database isperforming a lot of work. Even though UNIX page
ins must correlate
with the vmstat's refresh rate toaccurately predict RAM swapping, plotting page ins
can tell you
when the server is having spikes of RAMusage.
Once captured, it's very easy to take theinformation about server performance
directly from the
Oracle tables and plot them in a trendgraph. Rather than using an expensive
statistical package
such as SAS, you can use Microsoft Excel.Copy and paste the data from the tables
into Excel.
After that, you can use the Chart Wizard tocreate a line chart that will help you
view server
usage information and discover trends.
# VMSTAT AIX:
-------------
This is virtually equal to the usage ofvmstat under solaris.
vmstat can be used to give multiplestatistics on the system. For CPU-specific work,
try the following command:
# vmstat -t 1 3
This will take 3 samples, 1 second apart,with timestamps (-t). You can, of course,
change the parameters
as you like. The output is shown below.
kthr memory page faults cpu time
----- ----------- ------------------------------------ ----------- -------r
b avm fre re pi po fr sr cy in sy cs us syid wa hr mi se
0 0 0 1 0 224 326 362 24 769 0 15:10:22
0 0 0 0 0 159 83 53 1 1 980 15:10:23
0 0 0 0 0 145 115 46 0 9 901 15:10:24
In this output some of the things to watchfor are:
"avm", which is Active VirtualMemory.
Ideally, under normal conditions, thelargest avm value should in general be smaller
than the amount of RAM.
If avm is smaller than RAM, and still exessivepaging occurs, that could be due to
RAM being filled
with file pages.
avm x 4K = number of bytes
Columns r (run queue) and b (blocked) startgoing up, especially above 10. This
usually is an indication
that you have too many processes competingfor CPU.
If cs (contact switches) go very highcompared to the number of processes, then you
may need to tune
the system with vmtune.
In the cpu section, us (user time)indicates the time is being spent in programs.
Assuming Java is
at the top of the list in tprof, then youneed to tune the Java application).
In the cpu section, if sys (system time) ishigher than expected, and you still have
id (idle) time left,
this may indicate lock contention. Checkthe tprof for lock related calls in the
kernel time. You may want
to try multiple instances of the JVM. Itmay also be possible to find deadlocks in a
javacore file.
In the cpu section, if wa (I/O wait) ishigh, this may indicate a disk bottleneck,
and you should use
iostat and other tools to look at the diskusage.
Values in the pi, po (page in/out) columnsare non-zero may indicate that you are
paging and need more memory.
It may be possible that you have the stacksize set too high for some of your JVM
instances.
It could also mean that you have allocateda heap larger than the amount of memory on
the system. Of course,
you may also have other applications usingmemory, or that file pages may be taking
up too much of the memory
Other example:
# vmstat 1
System configuration: lcpu=2 mem=3920MB
kthr memory page faults cpu
r b avm fre re pi po fr sr cy in sy cs ussy id wa
0 0 745 0 0 0 0 0 0 3 198 69 0 099 0
0 0 745 0 0 0 0 0 0 3 33 66 0 099 0
0 0 745 0 0 0 0 0 0 2 33 68 0 099 0
0 0 745 0 0 0 0 0 0 80 306 100 01 97 1
0 0 745 0 0 0 0 0 0 1 20 68 0 099 0
0 0 745 0 0 0 0 0 0 2 36 64 0 099 0
0 0 745 0 0 0 0 0 0 2 33 66 0 099 0
0 0 745 0 0 0 0 0 0 2 21 66 0 099 0
0 0 745 0 0 0 0 0 0 1 237 64 0 099 0
0 0 745 0 0 0 0 0 0 2 19 66 0 099 0
0 0 745 0 0 0 0 0 0 6 37 76 0 099 0
The most important fields to look at hereare:
r -- The average number of runnable kernelthreads over whatever sampling interval
you have chosen.
b -- The average number of kernel threadsthat are in the virtual memory waiting
queue over your sampling interval. r shouldalw if it is not, it
usually means you have a CPU bottleneck.
fre -- The size of your memory free list.Do not worry so much if the amount is
really small. More importantly, determineif there is any paging going on if this
amount is small.
pi -- Pages paged in from paging space.
po -- Pages paged out to paging space.
CPU section:
Let's look at the last section, which alsocomes up in most other CPU monitoring
tools, albeit with different headings:
us -- user time
sy -- system time
id -- idle time
wa -- waiting on I/O
This command is useful for monitoring I/Oactivities. You can use the read and write
rate to estimate the
amount of time required for certain SQLoperations (if they are the only activity on
the system).
This command is also useful for determiningif something is suspended or just taking
a long time.
B&options& interval countasic synctaxis iostat
x options gives the extended
option - let you specify the device forwhich information is needed like disk ,
cpu or terminal. (-d , -c , -t
statistics .
or -tdc ) .
interval -4is time period in secondsbetween two samples . iostat will give data
at each 4 seconds interval.
count - is the number of times the data isneeded . iostat 4 5 will give data at 4
seconds interval 5 times.
$ iostat -xtc 5 2
extended disk statistics tty cpu
disk r/s w/s Kr/s Kw/s wait actv svc_t %w%b tin tout us sy wt id
sd0 2.6 3.0 20.7 22.7 0.1 0.2 59.2 6 19 084 3 85 11 0
sd1 4.2 1.0 33.5 8.0 0.0 0.2 47.2 2 23
sd2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd3 10.2 1.6 51.4 12.8 0.1 0.3 31.2 3 31
disk name of the disk
r/s reads per second
w/s writes per second
Kr/s kilobytes read per second
Kw/s kilobytes written per second
wait average number of transactions waitingfor service (Q length)
actv average number of transactionsactively
being serviced (removed from the queue butnot yet completed)
%w percent of time there are transactionswaiting for service (queue non-empty)
%b percent of time the disk is busy(transactions in progress)
Tare:he values to look from the iostatoutput
Reads/writes per second (r/s , w/s)
Percentage busy (%b)
Service time (svc_t)
If a disk shows consistently highreads/writes along with , the percentage busy (%b)
of the disks
is greater than 5 percent, and the averageservice time (svc_t) is greater than 30
milliseconds,
then action needs to be taken.
This command lets you know the networktraffic on each node, and the number of error
packets encountered.
It is useful for isolating networkproblems.
To find out all listening services, you canuse the command
# netstat -a -f inet
1.2.11 Some other utilities for Solaris:
========================================
For example:
load averages: 0.66, 0.54, 0.56 11:14:48
187 processes: 185 sleeping, 2 on cpu
CPU states: % idle, % user, % kernel, %iowait, % swap
Memory: 4096M real, 1984M free, 1902M swapin use, 2038M swap free
PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
2795 oraclown 1 59 0 265M 226M sleep 0:134.38% oracle
2294 root 11 59 0 K sleep 10:543.94% bpbkar
13907 oraclown 11 59 0 271M 218M cpu2 4:022.23% oracle
14138 oraclown 12 59 0 270M 230M sleep 9:031.76% oracle
2797 oraclown 1 59 0 189M 151M sleep 0:010.96% oracle
2787 oraclown 11 59 0 191M 153M sleep 0:060.69% oracle
2799 oraclown 1 59 0 190M 151M sleep 0:020.45% oracle
2743 oraclown 11 59 0 191M 155M sleep 0:250.35% oracle
2011 oraclown 11 59 0 191M 149M sleep 2:500.27% oracle
2007 oraclown 11 59 0 191M 149M sleep 2:220.26% oracle
2009 oraclown 11 59 0 191M 149M sleep 1:540.20% oracle
2804 oraclown 1 51 0 K cpu2 0:000.19% top
2013 oraclown 11 59 0 191M 148M sleep 0:360.14% oracle
2035 oraclown 11 59 0 191M 149M sleep 2:440.13% oracle
114 root 10 59 0 K sleep 23:340.05% picld
Process ID
This column shows the process ID (pid) ofeach process. The process ID is a positive
usually less than 65536. It is used foridentification during the life of the process.
Once a process has exited or been killed,the process ID can be reused.
This column shows the name of the user whoowns the process. The kernel stores this
information
as a uid, and top uses an appropriate table(/etc/passwd, NIS, or NIS+) to translate
this uid in to a name.
This column displays the number of threadsfor the current process. This column is
present only
in the Solaris 2 port of top.
For Solaris, this number is actually thenumber of lightweight processes (lwps)
created by the
threads package to handle the threads.Depending on current resource utilization,
there may not
be one lwp for every thread. Thus thisnumber is actually less than or equal to the
total number
of threads created by the process.
This column reflects the "nice"setting of each process. A process's nice is
inhereted from its parent.
Most user processes run at a nice of 0,indicating normal priority. Users have the
option of starting
a process with a positive nice value toallow the system to reduce the priority given
to that process.
This is normally done for long-runningcpu-bound jobs to keep them from interfering
interactive processes. The Unix command"nice" controls setting this value. Only root
a nice value lower than the current value.Nice values can be negative. On most
systems they range from -20 to 20.
The nice value influences the priorityvalue calculated by the Unix scheduler.
This column shows the total amount ofmemory allocated by each process. This is
virtual memory
and is the sum total of the process's textarea (program space), data area, and
dynamically
allocated area (or "break"). Whena process allocates additional memory with the
system call "brk",
this value will increase. This is doneindirectly by the C library function "malloc".
The number in this column does not reflectthe amount of physical memory currently in
use by the process.
Resident Memory
This column reflects the amount of physicalmemory currently allocated to each process.
This is also known as the "residentset size" or RSS. A process can have a large amount
of virtual memory allocated (as indicatedby the SIZE column) but still be using very
little physical memory.
Process State
This column reflects the last observedstate of each process. State names vary from
system to system.
These states are analagous to those thatappear in the process states line: the
second line of the display.
The more common state names are listedbelow.
cpu - Assigned to a CPU and currentlyrunning
run - Currently able to run
sleep - Awaiting an external event, such asinput from a device
stop - Stopped by a signal, as with controlZ
swap - Virtual address space swapped out todisk
zomb - Exited, but parent has not called"wait" to receive the exit status
This column displayes the accumulated CPUtime for each process. This is the amount
that any cpu in the system has spentactually running this process. The standard
format shows
two digits indicating minutes, a colon,then two digits indicating seconds.
For example, the display "15:32"indicates fifteen minutes and thirty-two seconds.
When a time value is greater than or equalto 1000 minutes, it is displayed as hours
with the suffix H.
For example, the display "127.4H"indicates 127 hours plus four tenths of an hour (24
When the number of hours exceeds 999.9, the"H" suffix is dropped so that the display
continues to fit in the column.
CPU Percentage
This column shows the percentage of the cputhat each process is currently consuming.
By default, top will sort this column ofthe output.
Some versions of Unix will track cpupercentages in the kernel, as the figure is used
in the calculation
of a process's priority. On those versions,top will use the figure as calculated by
the kernel.
Other versions of Unix do not perform thiscalculation, and top must determine the
percentage explicity
by monitoring the changes in cpu time.
On most multiprocessor machines, the numberdisplayed in this column is a percentage
of the total
available cpu capacity. Therefore, a singlethreaded process running on a four
processor system will never
use more than 25% of the available cpucycles.
This column displays the name of theexecutable image that each process is running.
In most cases this is the base name of thefile that was invoked with the most recent
kernel "exec" call.
On most systems, this name is maintainedseparately from the zeroth argument. A
program that changes
its zeroth argument will not affect theoutput of this column.
The modinfo command provides informationabout the modules currently loaded by the
The /etc/system file:
Available for Solaris OperatingEnvironment, the /etc/system file contains
definitions for kernel configuration limits
such as the maximum number of users allowedon the system at a time, the maximum
number of processes per user,
and the inter-process communication (IPC)limits on size and number of resources.
These limits are important because
they affect DB2 performance on a SolarisOperating Environment machine. See the Quick
Beginnings information
for further details.
# more /etc/path_to_inst
To see the mapping between the kernelabbreviated instance name for physical device
view the /etc/path_to_inst file.
uptime - show how long the system has beenup
/export/home/oraclown&uptime
11:32am up 4:19, 1 user, load average:0.40, 1.17, 0.90
1.2.12 proc toos for Solaris:
=============================
The proc tools are called that way, becausethe retreive information fromn the /proc
virtual filesystem
/usr/proc/bin/pflags [-r] pid...
/usr/proc/bin/pcred pid...
/usr/proc/bin/pmap [-rxlF] pid...
/usr/proc/bin/pldd[-F] pid...
/usr/proc/bin/psigpid...
/usr/proc/bin/pstack[-F] pid...
/usr/proc/bin/pfiles[-F] pid...
/usr/proc/bin/pwdx[-F] pid...
/usr/proc/bin/pstoppid...
/usr/proc/bin/prunpid...
/usr/proc/bin/pwait[-v] pid...
/usr/proc/bin/ptree [-a] [[pid| user]...]
/usr/proc/bin/ptime command [arg...]
/usr/proc/bin/pattr [-x ] [pid...]
/usr/proc/bin/pclear [pid...]
/usr/proc/bin/plabel [pid...]
/usr/proc/bin/ppriv [-a] [pid...]
-- pfiles:
reports all the files which are opened by agiven pid
lists all the dynamic libraries linked tothe process
gives the directory from which the processis running
The ptree utility prints the process treescontaining the specified pids or users,
with child processes
indented from their respective parentprocesses. An argument of all digits is taken
to be a process-ID,
otherwise it is assumed to be a user loginname. The default is all processes.
Use it like
# ptree &PID&
Or use it with params, which enables you toproduce different listings
The following example prints the processtree (including children of process 0) for
processes which match the command name ssh:
$ ptree -a 憄grep ssh?
1 /sbin/init
100909 /usr/lib/ssh/sshd
569150 /usr/lib/ssh/sshd
569157/usr/lib/ssh/sshd
569159 -ksh
569171 bash
569173 /bin/ksh
569193 bash
---------------------------------------------------------------------Remark:
many Linux distros adopted the ptreecommand, as the "pstree" command.
ubuntu$ pstree -pl
init(1)---NetworkManager(5427)
+-NetworkManagerD(5441)
+-acpid(5210)
+-apache2(6966)---apache2(2890)
? +-apache2(2893)
? +-apache2(7163)
? +-apache2(7165)
? +-apache2(7166)
? +-apache2(7167)
? +-apache2(7168)
+-atd(6369)
+-avahi-daemon(5658)---avahi-daemon(5659)
+-bonobo-activati(7816)---{bonobo-activati}(7817)
-----------------------------------------------------------------------Back
to Solaris again:
Suppose you did a pfiles on an Apacheprocess:
# pfiles 13789
13789:/apps11i/erpdev/10GAS/Apache/Apache/bin/httpd -d /apps11i/erpdev/10G
Current rlimit: 1024 file descriptors
0: S_IFIFO mode:0000 dev:350,0 ino:114723uid:65060 gid:54032 size:301
1: S_IFREG mode:0640 dev:307,28001ino:612208 uid:65060 gid:54032 size:386
O_WRONLY|O_APPEND|O_CREAT
/apps11i/erpdev/10GAS/opmn/logs/HTTP_Server~1
2: S_IFIFO mode:0000 dev:350,0 ino:143956uid:65060 gid:54032 size:0
3: S_IFREG mode:0600 dev:307,28001ino:606387 uid:65060 gid:54032 size:1056768
O_RDWR|O_CREAT
/apps11i/erpdev/10GAS/Apache/Apache/logs/mm.19389.mem
4: S_IFREG mode:0600 dev:307,28001ino:606383 uid:65060 gid:54032 size:0
O_RDWR|O_CREAT
5: S_IFREG mode:0600 dev:307,28001ino:621827 uid:65060 gid:54032 size:1056768
O_RDWR|O_CREAT
6: S_IFDOOR mode:0444 dev:351,0 ino:58uid:0 gid:0 size:0
O_RDONLY|O_LARGEFILE FD_CLOEXEC door tonscd[421]
/var/run/name_service_door
7: S_IFIFO mode:0000 dev:350,0 ino:143956uid:65060 gid:54032 size:0
8: S_IFCHR mode:0666 dev:342,0 ino:uid:0 gid:3 rdev:90,0
/devices/pseudo/kstat@0:kstat
O_RDWR|O_CREAT
/apps11i/erpdev/10GAS/Apache/Apache/logs/dms_metrics.19389.shm.sem
21: S_IFREG mode:0600 dev:307,28001ino:603445 uid:65060 gid:54032 size:17408
O_RDONLY FD_CLOEXEC
/apps11i/erpdev/10GAS/rdbms/mesg/ocius.msb
23: S_IFSOCK mode:0666 dev:348,0 ino:60339uid:0 gid:0 size:0
SOCK_STREAM
SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.0.192.0)
sockname: AF_INET 3.56.189.4 port: 45395
peername: AF_INET 3.56.189.4 port: 12501
256: S_IFREG mode:0444 dev:85,0 ino:234504uid:0 gid:3 size:1616
O_RDONLY|O_LARGEFILE
/etc/inet/hosts
Suppose you tried pldd on the same processgave this result:
# pldd 13789
13789: /apps11i/erp
dev/10GAS/Apache/Apache/bin/httpd -d/apps11i/erpdev/10G
/apps11i/erpdev/10GAS/lib32/libdms2.so
/lib/libpthread.so.1
/lib/libsocket.so.1
/lib/libnsl.so.1
/lib/libdl.so.1
/lib/libc.so.1
/platform/sun4u-us3/lib/libc_psr.so.1
/lib/libmd5.so.1
/platform/sun4u/lib/libmd5_psr.so.1
/lib/libscf.so.1
/lib/libdoor.so.1
/lib/libuutil.so.1
/lib/libgen.so.1
/lib/libmp.so.2
/lib/libm.so.2
/lib/libresolv.so.2
/apps11i/erpdev/10GAS/Apache/Apache/libexec/mod_onsint.so
/lib/librt.so.1
/apps11i/erpdev/10GAS/lib32/libons.so
/lib/libkstat.so.1
/lib/libaio.so.1
/apps11i/erpdev/10GAS/Apache/Apache/libexec/mod_mmap_static.so
/apps11i/erpdev/10GAS/Apache/Apache/libexec/mod_vhost_alias.so
/apps11i/erpdev/10GAS/Apache/Apache/libexec/mod_env.so
/usr/lib/libsched.so.1
/apps11i/erpdev/10GAS/lib32/libclntsh.so.10.1
/apps11i/erpdev/10GAS/lib32/libnnz10.so
/apps11i/erpdev/10GAS/Apache/Apache/libexec/mod_wchandshake.so
/apps11i/erpdev/10GAS/Apache/Apache/libexec/mod_oc4j.so
/apps11i/erpdev/10GAS/Apache/Apache/libexec/mod_dms.so
/apps11i/erpdev/10GAS/Apache/Apache/libexec/mod_rewrite.so
/apps11i/erpdev/10GAS/Apache/oradav/lib/mod_oradav.so
/apps11i/erpdev/10GAS/Apache/modplsql/bin/modplsql.so
# pmap -x $$
492328: -ksh
Address Kbytes RSS Anon Locked Mode MappedFile
192 -- r-x--ksh
8 8 - rwx--ksh
40 8 - rwx--[ heap ]
FF 680 -- r-x--libc.so.1
FF23A000 24 24 -- rwx--libc.so.1
FF 8 8 - rwx--libc.so.1
FF 576 -- r-x--libnsl.so.1
FF 40 -- rwx--libnsl.so.1
FF31A000 24 16 -- rwx--libnsl.so.1
FF 16 -- r-x--libmp.so.2
FF 8 -- rwx--libmp.so.2
FF 40 -- r-x--libsocket.so.1
FF39A000 8 8 -- rwx--libsocket.so.1
FF3A -- r-x--libdl.so.1
FF3B 8 - rwx--[ anon ]
FF3C -- r-x--ld.so.1
FF3F 8 - rwx--ld.so.1
FFBFC000 16 16 8 - rw---[ stack ]
-------- ------- ------- ------- -------
1.2.13 Wellknown tools for AIX:
===============================
1. commands:
------------
CPU Memory Subsystem I/O Subsystem NetworkSubsystem
---------------------------------------------------------------------------------
vmstat vmstatiostat netstat
iostat lspsvmstat ifconfig
ps svmon lsps tcpdump
sar filemon filemon
tprof ipcs lvmstat
nmon and topas can be used to monitor thosesubsystems in general.
topas is a useful graphical interface thatwill give you immediate results of what is
going on in the system.
When you run it without any command-linearguments, the screen looks like this:
Topas Monitor for host: aix4prtEVENTS/QUEUES FILE/TTY
Mon Apr 16 16:16:50 2001 Interval: 2Cswitch 5984 Readch 4864
Syscall 15776 Writech 34280
Kernel 63.1 |################## | Reads 8Rawin 0
User 36.8 |########## | Writes 2469 Ttyout0
Wait 0.0 | | Forks 0 Igets 0
Idle 0.0 | | Execs 0 Namei 4
Runqueue 11.5 Dirblk 0
Network KBPS I-Pack O-Pack KB-In KB-OutWaitqueue 0.0
lo0 213.9 3.7 107.0 106.9
tr0 34.7 16.9 34.4 0.9 33.8 PAGING MEMORY
Faults 3862 Real,MB 1023
Disk Busy% KBPS TPS KB-Read KB-Writ Steals1580 % Comp 27.0
hdisk0 0.0 0.0 0.0 0.0 0.0 PgspIn 0 %Noncomp 73.9
PgspOut 0 % Client 0.5
Name PID CPU% PgSp Owner PageIn 0
35.1 root PageOut 0 PAGINGSPACE
86.2 root Sios 0 Size,MB512
0.0 root % Used 1.2
0.7 root NFS (calls/sec)% Free 98.7
0.8 root ServerV2 0
0.7 root ClientV2 0 Press:
0.0 root ServerV3 0"h" for help
The information on the bottom left sideshows the m here, java
is consuming 83.6% of CPU.
The middle right area shows the totalphysical memory (1 GB in this case) and Paging
space (512 MB),
as well as the amount being used. So youget an excellent overview of what the system
in a single screen, and then you can selectthe areas to concentrate based on the
information being shown here.
Note: about waits:
Don't get caught up in this whole wait i/othing. a single cpu system
with 1 i/o outstanding and no other runablethreads (i.e. idle) will
have 100% wait i/o. There was a bigdiscussion a couple of years ago on
removing the kernel tick as it has confusedmany many many techs.
So, if you have only 1 or few cpu, then youare going to have high wait i.o
figures, it does not neccessarily mean yourdisk subsystem is slow.
trace captures a sequential flow oftime-stamped system events. The trace is a
valuable tool for observing
system and application execution. Whilemany of the other tools provide high level
statistics such as
CPU and I/O utilization, the trace facilityhelps expand the information as to where
the events happened,
which process is responsible, when theevents took place, and how they are affecting
the system.
Two post processing tools that can extractinformation from the trace are utld (in
AIX 4) and curt
(in AIX 5). These provide statistics on CPUutilization and process/thread activity.
The third post
processing tool is splat which stands forSimple Performance Lock Analysis Tool. This
tool is used to analyze
lock activity in the AIX kernel and kernelextension for simple locks.
nmon is a free software tool that givesmuch of the same information as topas, but
saves the information
to a file in Lotus 123 and Excel format.The download site is
/developerworks/eserver/articles/analyze_aix/.
The information that is collected includedCPU, disk, network, adapter statistics,
kernel counters,
memory and the "top" processinformation.
tprof is one of the AIX legacy tools thatprovides a detailed profile of CPU usage
AIX process ID and name. It has beencompletely rewritten for AIX 5.2, and the
example below uses
the AIX 5.1 syntax. You should refer to AIX5.2 Performance Tools update: Part 3 for
the new syntax.
The simplest way to invoke this command isto use:
# tprof -kse -x "sleep 10"
# tprof -ske -x "sleep 30"
At the end of ten seconds, or 30 seconds, anew file __prof.all, or sleep.prof, is
generated that contains
information about what commands are usingCPU on the system. Searching for FREQ, the
information looks something
like the example below:
Process FREQ Total Kernel User Shared Other
======= === ===== ====== ==== ====== =====
oracle 244
======= === ===== ====== ==== ====== =====
This example shows that over half the CPUtime is associated with the oracle
application and that Java
is using about
or 1/5 of theCPU. The wait usually means idle time, but
can also include
the I/O wait portion of the CPU usage.
The svmon command captures a snapshot ofthe current state om memory.
use it with the -G switch to get globalstatistics for the whole system.
svmon is the most useful tool at yourdisposal when monitoring a Java process,
especially native heap.
The article "When segmentscollide" gives examples of how to use svmon -P &pid& -m to
monitor the
native heap of a Java process on AIX. Butthere is another variation, svmon -P &pid&
-m -r, that is very
effective in identifying native heapfragmentation. The -r switch prints the address
range in use, so it gives
a more accurate view of how much of eachseg
&&&&推荐文章:
【上篇】【下篇】

我要回帖

更多关于 数据有效性 跨工作表 的文章

 

随机推荐