全部博文(19)
分类:
2008-04-21 18:04:14
Solaris之硬件信息常识
一、CPU
CPU个数、主频、型号、使用情况
oracle@swallow5$ psrinfo -v Status of virtual processor 1 as of: 02/26/2008 17:28:29 on-line since 07/25/2007 03:55:37. The sparcv9 processor operates at 1500 MHz, and has a sparcv9 floating point processor. Status of virtual processor 3 as of: 02/26/2008 17:28:29 on-line since 07/25/2007 03:55:35. The sparcv9 processor operates at 1500 MHz, and has a sparcv9 floating point processor. Status of virtual processor 17 as of: 02/26/2008 17:28:29 on-line since 07/25/2007 03:55:37. The sparcv9 processor operates at 1500 MHz, and has a sparcv9 floating point processor. Status of virtual processor 19 as of: 02/26/2008 17:28:29 on-line since 07/25/2007 03:55:37. The sparcv9 processor operates at 1500 MHz, and has a sparcv9 floating point processor. oracle@swallow5$ psrinfo -vp The UltraSPARC-IV+ physical processor has 2 virtual processors (1, 17) The UltraSPARC-IV+ physical processor has 2 virtual processors (3, 19) oracle@swallow5$ mpstat CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 1 138 0 142 28 1 133 18 69 150 1 136 2 1 4 93 3 127 0 175 99 202 149 6 14 48 1 155 2 1 3 94 17 126 0 122 72 48 102 18 24 208 1 221 2 1 4 94 19 110 0 114 34 13 123 15 228 146 1 143 2 1 3 94 |
二、内存
1、 物理总内存
2、 分配给Solaris核心的内存数量
3、 文件系统缓存使用的内存数量
4、 进程使用的内存数量
5、 系统剩余的内存数量
6、 共享内存shmsys:shminfo_shmmax参数含义(/etc/system文件中)
物理总内存 oracle@swallow5$ prtconf | head -2 System Configuration: Sun Microsystems sun4u Memory size: 8192 Megabytes 分配给Solaris核心的内存数量 使用sar –k察看系统核心占用的内存,如下3个内存池之和即是,单位byte oracle@swallow5$ sar -k 1 1 SunOS swallow5 5.9 Generic_118558-28 sun4u 17:42:28 sml_mem alloc fail lg_mem alloc fail ovsz_alloc fail 17:42:29 96543360 64564600 0 937050112 768296448 0 57196544 0 96543360+937050112+57196544= 1090790016 byte= 文件系统缓存使用的内存数量(File System Caching Memory) 文件系统缓存使用系统可用的剩余内存缓存文件。在Solaris上,可用的剩余内存(free memory)大部分情况下总是接近0;Solaris8之前,vmstat 显示的free列表示可用的剩余内存,往往在系统启动(booted)的时候很高,随着系统运行慢慢降低为0,这是正常的,因为文件系统缓存的设计目的就是最大化利用系统可用内存来缓存最经常访问的文件。 在Solaris8中,vmstat 显示的free是系统可用的剩余内存(free memory)和可pageable的文件系统缓存(file system cache memory),man的解释:free size of the free list (Kbytes) 。文件系统缓存也挂在内存Free List上。 oracle@swallow5$ vmstat 3 2 kthr memory page disk faults cpu r b w swap free re mf pi po fr de sr m 0 0 0 2209392 1072864 60 501 27 2 2 0 0 0 0 0 0 233 655 507 2 1 97 0 0 0 2498680 1234080 29 190 0 0 0 0 0 0 0 0 0 378 6336 5531 0 1 99 vmstat 结果表示,文件系统缓存占用了将近1234080k byte。 也就是说Solaris下,内存不会闲着,没事也会跟你填满,有进程要用的话再让出来。 系统剩余的内存数量(Free Memory) 由于文件系统缓存总是尽量利用可用的剩余内存缓存文件,因此大部分情况下Free memory总是接近0 进程使用的内存数量 进程使用总量 (就是各进程size之和) oracle@swallow5$ prstat PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/ 14409 autosys 14414 autosys 14378 autosys 7577 oracle 1314 root 5560K 3728K sleep 59 0 25:38:01 0.1% .devSvrS 759 root 5560K 3704K sleep 59 0 26:11:12 0.1% .gui 14507 oracle 4760K 4528K cpu3 59 0 0:00:00 0.0% prstat/1 448 root 5435 autosys 14413 autosys 1152K 1000K sleep 59 0 0:00:00 0.0% sh/1 14432 oracle 14446 oracle 14408 autosys 1152K 1000K sleep 59 0 0:00:00 0.0% sh/1SvrMa 14386 oracle 4860 oracle 898 root 14377 autosys 1152K 1000K sleep 59 0 0:00:00 0.0% sh/1SvrManage 14384 autosys 9584K 5144K sleep 59 0 0:00:00 0.0% auto_remote/1 14410 autosys 1104K 968K sleep 59 0 0:00:00 0.0% sh/1/1 12237 oracle 14405 autosys 1104K 968K sleep 59 0 0:00:00 0.0% sh/1 1 root 1280K 464K sleep 59 0 0:18:46 0.0% init/1 14374 autosys 1104K 968K sleep 59 0 0:00:00 0.0% sh/1 14387 autosys 9584K 5144K sleep 59 0 0:00:00 0.0% auto_remote/1 1619 root 1240K 992K sleep 59 0 0:11:14 0.0% .highAvailS 8179 root 563 root 658 root 23224 oracle 2632K 2136K sleep 59 0 0:00:00 0.0% bash/14 351 root 5176K 2368K sleep 59 0 0:00:01 0.0% dtlogin/1 5437 autosys 1968K 1352K sleep 59 0 0:01:28 0.0% event 2050 root 3744K 1224K sleep 59 0 0:00:00 0.0% snmpXdmid/2 380 root 6768K 1072K sleep 59 0 0:00:00 0.0% Xvfb/ 2045 root 2928K 2256K sleep 59 0 0:00:01 0.0% mibiisa/7 265 root 3056K 1040K sleep 59 0 0:00:00 0.0% mdmonitord/1 260 root 2944K 1120K sleep 59 0 0:00:00 0.0% rpc.metad/1 251 root 976K 584K sleep 59 0 0:00:00 0.0% htt/1itord/1 253 root 3224K 1176K sleep 59 0 0:00:00 0.0% htt_server/2 Total: 158 processes, 1523 lwps, load averages: 0.29, 0.23, 0.18 单(多)个进程内存使用情况 共享内存shmsys:shminfo_shmmax参数含义(/etc/system文件中) 官方的描述是: Description Maximum size of system V shared memory segment that can be created. This parameter is an upper limit that is checked before the system sees if it actually has the physical resources to create the requested memory segment. Attempts to create a shared memory section whose size is zero or whose size is larger than the specified value will fail with an EINVAL error. Data Type Unsigned long Default 8,388,608 or 1,048,576 Range 0 - MAXINT on 32-bit systems, MAXINT64 on 64-bit systems Units Bytes Dynamic? No. Loaded into shmmax field of shminfo structure. Validation None When to Change When the default value is too low. Generally changed at the recommendation of software vendors, but unless the size of a shared memory segment needs to be constrained, setting this parameter to the maximum possible value has no side effects. Commitment Level 就是单个进程(程序)所能允许分配内存的最大值,例如Oracle可能要10多G以上的内存,如果此时发现该值过小的话,就改它然后重启机器,不然Oracle会启动不了(out of memory)。 |