linux系统性能监控--内存利用率

    Linux提供了对物理内存进行合理、高效的访问并可以访问潜在的海量虚存的技术。虚存通常稍多于操作系统实际拥有的内存容量,以便将较少使用的数据卸载到磁盘存储器上,同时又呈现出系统拥有大量物理内存的假象。糟糕的是,卸载内存的开销可能会比应用延迟高出数十甚至上百倍。如果被换出到磁盘上的内存空间是错误的内存页,或者如果应用程序的当前内存印迹大于物理内存容量的话,那么这些过高的延迟会极大地影响应用的响应时间。

    许多性能问题都是由于内存不足而引起操作系统的交换。因此,有必要利用一些工具来监视内存的使用情况, 例如,每个进程或线程的内核内存占用量,以及内核数据结构的内存使用机制及其数量和大小。与 CPU利用情况一样, 理解操作系统和各个进程的行为对于跟踪内存短缺所引起的任何性能问题至关重要


一、/proc/meminfo/proc/slabinfo

    linux /proc文件系统中提供了可以监视系统内存资源整体利用情况的工具,即/proc/meminfo/proc/slabinfo。 这两个文件可以捕获物理内存的状态。 /proc/meminfo的部分显示结果如下所示 :

MemTotal:        8193720 kB
MemFree:         1360188 kB
Buffers:           52580 kB
Cached:          5048416 kB
SwapCached:       117912 kB
Active:          2394100 kB
Inactive:        3969480 kB
Active(anon):     890840 kB
Inactive(anon):   607480 kB
Active(file):    1503260 kB
Inactive(file):  3362000 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       4128760 kB
SwapFree:         276380 kB
Dirty:               364 kB
Writeback:             0 kB
AnonPages:       1144908 kB
Mapped:           101328 kB
Shmem:            235736 kB
Slab:             321044 kB
SReclaimable:     235768 kB
SUnreclaim:        85276 kB
KernelStack:        7392 kB
PageTables:        64532 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     8225620 kB
Committed_AS:   180158196 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      289596 kB
VmallocChunk:   34359446152 kB
HardwareCorrupted:     0 kB
AnonHugePages:    456704 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       10240 kB
DirectMap2M:     8378368 kB
[huangc@V-02-01-00860 ~]$ 
  • MemTotal:显示了物理内存总量
  • MemFree:显示了未用内存的总量
  • Buffers:对应于 I/O操作的缓冲区 cache,用来给文件做缓冲大小。
  • Cached:表示从磁盘上读取文件时所用的内存大,被高速缓冲储存器用的内存的大小 。
  • SwapCached:表示已被换出到交换空间中的内存缓存大小,被高速缓冲储存器用的交换空间的大小,其仍然被存放在swapfile中,用来在需要的时候很快的被替换而不需要再次打开I/O端口。
  • Active: 在活跃使用中的缓冲或高速缓冲储存器页面文件的大小,除非非常必要否则不会被移作他用。
  • Inactive: 在不经常使用中的缓冲或高速缓冲储存器页面的大小,可能被用于其他用途。
  • SwapTotal:表示用于交换用途的磁盘内存大小。如果基于 IA32的系统拥有 1GB以上的物理内存,则 HighTotal为非零值。
  • HighTotal:对应高于 860MB的物理内存。
  • LowTotal:是内核使用的内存。 
  • Mapped:对应于被内存映射的文件大小。
  • Slab:表示为内核数据结构分配的内存。

二、ps
 
    要获知特定进程中的内存使用情况,可以使用ps工具来获取每个进程的内存占用情况:
[solarflar@localhost ~]$ ps aux
USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root          1  0.0  0.0  52876 15652 ?        Ss   8月09   2:49 /usr/lib/systemd/systemd --switched-root --system --deserialize 21
root          2  0.0  0.0      0     0 ?        S    8月09   0:00 [kthreadd]
root          3  0.0  0.0      0     0 ?        S    8月09   0:01 [ksoftirqd/0]
root          5  0.0  0.0      0     0 ?        S<   8月09   0:00 [kworker/0:0H]
root          8  0.0  0.0      0     0 ?        S    8月09   0:00 [migration/0]
root          9  0.0  0.0      0     0 ?        S    8月09   0:00 [rcu_bh]
root         10  0.0  0.0      0     0 ?        S    8月09   0:00 [rcuob/0]
root         11  0.0  0.0      0     0 ?        S    8月09   0:00 [rcuob/1]
root         12  0.0  0.0      0     0 ?        S    8月09   0:00 [rcuob/2]
root         13  0.0  0.0      0     0 ?        S    8月09   0:00 [rcuob/3]
root         14  0.0  0.0      0     0 ?        S    8月09   0:00 [rcuob/4]
    ps aux的输出结果显示了每个进程消耗系统内存的总体百分比,以及该进程的虚存印迹(VSZ)和当前使用的物理内存量(RSS)。也可以使用 top(1)通过交互方式对进程列表进行排序,以便查看哪些进程当前消耗的内存最多,以及内存使用情况如何随着系统的运行而变化 。
    当标识出需要关注的进程后,可以查看这些进程的虚址空间布局,从而获知进程当前使用内存的具体分配情况。 /proc/pid/maps包含了进程地址空间的所有映射及其大小,其中 pid是通过 ps(1)top(1)命令获得的特定进程 ID。 每个映射显示了被分配的地址范
围、页面的许可权限,以及与该地址范围相关的后备存储器
(backing store)(如果存在的话)的位置。 /proc/pid/maps本质上并不是一种性能工具; 然而, 它提供了关于内存分配状况的信息。 例如,出于性能分析的目的,可以确认在虚址空间中的 1GB2GB之间是否分配了特定数量的共享内存。可以根据前述的映射图来检查其使用情况 。
    以下是关于进程 ID 30829的输出结果 :
[huangc@V-02-01-00860 ~]$ cat /proc/30829/maps 
00400000-0040d000 r-xp 00000000 fd:02 6291478                            /home/huangc/linux.x64/bin/hsserver
0050c000-0050d000 rw-p 0000c000 fd:02 6291478                            /home/huangc/linux.x64/bin/hsserver
00a35000-02882000 rw-p 00000000 00:00 0                                  [heap]
3209800000-3209816000 r-xp 00000000 fd:00 1441795                        /lib64/libgcc_s-4.4.7-20120601.so.1
3209816000-3209a15000 ---p 00016000 fd:00 1441795                        /lib64/libgcc_s-4.4.7-20120601.so.1
3209a15000-3209a16000 rw-p 00015000 fd:00 1441795                        /lib64/libgcc_s-4.4.7-20120601.so.1
3209c00000-3209ce8000 r-xp 00000000 fd:00 1709911                        /usr/lib64/libstdc++.so.6.0.17
3209ce8000-3209ee8000 ---p 000e8000 fd:00 1709911                        /usr/lib64/libstdc++.so.6.0.17
3209ee8000-3209ef0000 r--p 000e8000 fd:00 1709911                        /usr/lib64/libstdc++.so.6.0.17
3209ef0000-3209ef2000 rw-p 000f0000 fd:00 1709911                        /usr/lib64/libstdc++.so.6.0.17
3209ef2000-3209f07000 rw-p 00000000 00:00 0 
3b4d600000-3b4d620000 r-xp 00000000 fd:00 1442337                        /lib64/ld-2.12.so
3b4d81f000-3b4d820000 r--p 0001f000 fd:00 1442337                        /lib64/ld-2.12.so
3b4d820000-3b4d821000 rw-p 00020000 fd:00 1442337                        /lib64/ld-2.12.so
3b4d821000-3b4d822000 rw-p 00000000 00:00 0 
3b4da00000-3b4da83000 r-xp 00000000 fd:00 1442339                        /lib64/libm-2.12.so
3b4da83000-3b4dc82000 ---p 00083000 fd:00 1442339                        /lib64/libm-2.12.so
3b4dc82000-3b4dc83000 r--p 00082000 fd:00 1442339                        /lib64/libm-2.12.so
3b4dc83000-3b4dc84000 rw-p 00083000 fd:00 1442339                        /lib64/libm-2.12.so
3b4de00000-3b4df8b000 r-xp 00000000 fd:00 1442338                        /lib64/libc-2.12.so
3b4df8b000-3b4e18a000 ---p 0018b000 fd:00 1442338                        /lib64/libc-2.12.so
3b4e18a000-3b4e18e000 r--p 0018a000 fd:00 1442338                        /lib64/libc-2.12.so
3b4e18e000-3b4e18f000 rw-p 0018e000 fd:00 1442338                        /lib64/libc-2.12.so
3b4e18f000-3b4e194000 rw-p 00000000 00:00 0 
3b4e200000-3b4e202000 r-xp 00000000 fd:00 1442343                        /lib64/libdl-2.12.so
3b4e202000-3b4e402000 ---p 00002000 fd:00 1442343                        /lib64/libdl-2.12.so
3b4e402000-3b4e403000 r--p 00002000 fd:00 1442343                        /lib64/libdl-2.12.so
3b4e403000-3b4e404000 rw-p 00003000 fd:00 1442343                        /lib64/libdl-2.12.so
3b4e600000-3b4e617000 r-xp 00000000 fd:00 1441865                        /lib64/libpthread-2.12.so
3b4e617000-3b4e817000 ---p 00017000 fd:00 1441865                        /lib64/libpthread-2.12.so
3b4e817000-3b4e818000 r--p 00017000 fd:00 1441865                        /lib64/libpthread-2.12.so
3b4e818000-3b4e819000 rw-p 00018000 fd:00 1441865                        /lib64/libpthread-2.12.so
3b4e819000-3b4e81d000 rw-p 00000000 00:00 0 
3b4ea00000-3b4ea15000 r-xp 00000000 fd:00 1442342                        /lib64/libz.so.1.2.3
3b4ea15000-3b4ec14000 ---p 00015000 fd:00 1442342                        /lib64/libz.so.1.2.3
3b4ec14000-3b4ec15000 r--p 00014000 fd:00 1442342                        /lib64/libz.so.1.2.3
3b4ec15000-3b4ec16000 rw-p 00015000 fd:00 1442342                        /lib64/libz.so.1.2.3
3b4ee00000-3b4ee07000 r-xp 00000000 fd:00 1442360                        /lib64/librt-2.12.so
3b4ee07000-3b4f006000 ---p 00007000 fd:00 1442360                        /lib64/librt-2.12.so
3b4f006000-3b4f007000 r--p 00006000 fd:00 1442360                        /lib64/librt-2.12.so
3b4f007000-3b4f008000 rw-p 00007000 fd:00 1442360                        /lib64/librt-2.12.so
3b57200000-3b57348000 r-xp 00000000 fd:00 1712089                        /usr/lib64/libxml2.so.2.7.6
3b57348000-3b57547000 ---p 00148000 fd:00 1712089                        /usr/lib64/libxml2.so.2.7.6
3b57547000-3b57551000 rw-p 00147000 fd:00 1712089                        /usr/lib64/libxml2.so.2.7.6
3b57551000-3b57552000 rw-p 00000000 00:00 0 
3b60200000-3b60216000 r-xp 00000000 fd:00 1442375                        /lib64/libnsl-2.12.so
3b60216000-3b60415000 ---p 00016000 fd:00 1442375                        /lib64/libnsl-2.12.so
3b60415000-3b60416000 r--p 00015000 fd:00 1442375                        /lib64/libnsl-2.12.so
3b60416000-3b60417000 rw-p 00016000 fd:00 1442375                        /lib64/libnsl-2.12.so
3b60417000-3b60419000 rw-p 00000000 00:00 0 
7f2744000000-7f2744021000 rw-p 00000000 00:00 0 
7f2744021000-7f2748000000 ---p 00000000 00:00 0 
7f274c000000-7f274c021000 rw-p 00000000 00:00 0 
7f274c021000-7f2750000000 ---p 00000000 00:00 0 
7f2750000000-7f2750021000 rw-p 00000000 00:00 0 
7f2750021000-7f2754000000 ---p 00000000 00:00 0 
7f2754000000-7f2754025000 rw-p 00000000 00:00 0 
7f2754025000-7f2758000000 ---p 00000000 00:00 0 
7f2758000000-7f2758021000 rw-p 00000000 00:00 0 
7f2758021000-7f275c000000 ---p 00000000 00:00 0 
7f275c000000-7f275c021000 rw-p 00000000 00:00 0 
7f275c021000-7f2760000000 ---p 00000000 00:00 0 
7f2760000000-7f2760021000 rw-p 00000000 00:00 0 
7f2760021000-7f2764000000 ---p 00000000 00:00 0 
7f2764000000-7f2764021000 rw-p 00000000 00:00 0 
7f2764021000-7f2768000000 ---p 00000000 00:00 0 
7f2768000000-7f2768021000 rw-p 00000000 00:00 0 
7f2768021000-7f276c000000 ---p 00000000 00:00 0 
7f276c000000-7f276c021000 rw-p 00000000 00:00 0 
7f276c021000-7f2770000000 ---p 00000000 00:00 0 
7f27725f7000-7f27725f8000 ---p 00000000 00:00 0 
7f27725f8000-7f2772ff8000 rw-p 00000000 00:00 0 
7f2772ff8000-7f2772ff9000 ---p 00000000 00:00 0 
7f2772ff9000-7f27739f9000 rw-p 00000000 00:00 0 
7f27739f9000-7f27739fa000 ---p 00000000 00:00 0 
7f27739fa000-7f27743fa000 rw-p 00000000 00:00 0 
7f27743fa000-7f27743fb000 ---p 00000000 00:00 0 
7f27743fb000-7f2774dfb000 rw-p 00000000 00:00 0 
7f2774dfb000-7f2774dfc000 ---p 00000000 00:00 0 
7f2774dfc000-7f27757fc000 rw-p 00000000 00:00 0 
7f27757fc000-7f27757fd000 ---p 00000000 00:00 0 
7f27757fd000-7f27761fd000 rw-p 00000000 00:00 0 
7f27761fd000-7f27761fe000 ---p 00000000 00:00 0 
7f27761fe000-7f2776bfe000 rw-p 00000000 00:00 0 
7f2776bfe000-7f2776bff000 ---p 00000000 00:00 0 
7f2776bff000-7f27775ff000 rw-p 00000000 00:00 0 
7f27775ff000-7f2777600000 ---p 00000000 00:00 0 
7f2777600000-7f2778000000 rw-p 00000000 00:00 0 
7f2778000000-7f2778021000 rw-p 00000000 00:00 0 
7f2778021000-7f277c000000 ---p 00000000 00:00 0 
7f277e1fd000-7f277e1fe000 ---p 00000000 00:00 0 
7f277e1fe000-7f277ebfe000 rw-p 00000000 00:00 0 
7f277ebfe000-7f277ebff000 ---p 00000000 00:00 0 
7f277ebff000-7f277f5ff000 rw-p 00000000 00:00 0 
7f277f5ff000-7f277f600000 ---p 00000000 00:00 0 
7f277f600000-7f2780000000 rw-p 00000000 00:00 0 
7f2780000000-7f2780021000 rw-p 00000000 00:00 0 
7f2780021000-7f2784000000 ---p 00000000 00:00 0 
7f27841ed000-7f27841ee000 ---p 00000000 00:00 0 
7f27841ee000-7f2784bee000 rw-p 00000000 00:00 0 
7f2784bee000-7f2784bef000 ---p 00000000 00:00 0 
7f2784bef000-7f27855ef000 rw-p 00000000 00:00 0 
7f27855ef000-7f27855f0000 ---p 00000000 00:00 0 
7f27855f0000-7f2785ff0000 rw-p 00000000 00:00 0 
7f2785ff0000-7f2785ff1000 ---p 00000000 00:00 0 
7f2785ff1000-7f27869f1000 rw-p 00000000 00:00 0 
7f27869f1000-7f27869f2000 ---p 00000000 00:00 0 
7f27869f2000-7f27873f2000 rw-p 00000000 00:00 0 
7f27873f2000-7f27873f3000 ---p 00000000 00:00 0 
7f27873f3000-7f2787df3000 rw-p 00000000 00:00 0 
7f2787df3000-7f2787df4000 ---p 00000000 00:00 0 
7f2787df4000-7f27887f4000 rw-p 00000000 00:00 0 
7f27887f4000-7f27887f5000 ---p 00000000 00:00 0 
7f27887f5000-7f27891f5000 rw-p 00000000 00:00 0 
7f27891f5000-7f27891f6000 ---p 00000000 00:00 0 
7f27891f6000-7f2789bf6000 rw-p 00000000 00:00 0 
7f2789bf6000-7f2789bf7000 ---p 00000000 00:00 0 
7f2789bf7000-7f278a5f7000 rw-p 00000000 00:00 0 
7f278a5f7000-7f278a5f8000 ---p 00000000 00:00 0 
7f278a5f8000-7f278aff8000 rw-p 00000000 00:00 0 
7f278aff8000-7f278aff9000 ---p 00000000 00:00 0 
7f278aff9000-7f278b9f9000 rw-p 00000000 00:00 0 
7f278b9f9000-7f278b9fa000 ---p 00000000 00:00 0 
7f278b9fa000-7f278c3fa000 rw-p 00000000 00:00 0 
7f278c3fa000-7f278c3fb000 ---p 00000000 00:00 0 
7f278c3fb000-7f278cdfb000 rw-p 00000000 00:00 0 
7f278cdfb000-7f278cdfc000 ---p 00000000 00:00 0 
7f278cdfc000-7f278d7fc000 rw-p 00000000 00:00 0 
7f278d7fc000-7f278d7fd000 ---p 00000000 00:00 0 
7f278d7fd000-7f278e1fd000 rw-p 00000000 00:00 0 
7f278e1fd000-7f278e1fe000 ---p 00000000 00:00 0 
7f278e1fe000-7f278ebfe000 rw-p 00000000 00:00 0 
7f278ebfe000-7f278ebff000 ---p 00000000 00:00 0 
7f278ebff000-7f278f5ff000 rw-p 00000000 00:00 0 
7f278f5ff000-7f278f600000 ---p 00000000 00:00 0 
7f278f600000-7f2790000000 rw-p 00000000 00:00 0 
7f2790000000-7f2790025000 rw-p 00000000 00:00 0 
7f2790025000-7f2794000000 ---p 00000000 00:00 0 
7f279482a000-7f279482b000 ---p 00000000 00:00 0 
7f279482b000-7f279522b000 rw-p 00000000 00:00 0 
7f279522b000-7f279522c000 ---p 00000000 00:00 0 
7f279522c000-7f2795c2c000 rw-p 00000000 00:00 0 
7f2795c2c000-7f2795cad000 rw-s 00000000 00:0f 31411390                   /dev/shm/warmstandby_hc#1_statusACDShm
7f2795cad000-7f2796131000 rw-p 00000000 00:00 0 
7f2796131000-7f279614c000 r-xp 00000000 fd:02 6291524                    /home/huangc/linux.x64/lib/libfsc_f2ospf.so
7f279614c000-7f279624b000 ---p 0001b000 fd:02 6291524                    /home/huangc/linux.x64/lib/libfsc_f2ospf.so
7f279624b000-7f279624d000 rw-p 0001a000 fd:02 6291524                    /home/huangc/linux.x64/lib/libfsc_f2ospf.so
7f279624d000-7f2796254000 rw-p 00000000 00:00 0 
7f2796254000-7f2796275000 r-xp 00000000 fd:02 6291508                    /home/huangc/linux.x64/lib/libfsc_channel_f2.so
7f2796275000-7f2796375000 ---p 00021000 fd:02 6291508                    /home/huangc/linux.x64/lib/libfsc_channel_f2.so
7f2796375000-7f2796377000 rw-p 00021000 fd:02 6291508                    /home/huangc/linux.x64/lib/libfsc_channel_f2.so
7f2796377000-7f27963d4000 r-xp 00000000 fd:02 6291549                    /home/huangc/linux.x64/lib/libmc2_mcapi.so
7f27963d4000-7f27964d4000 ---p 0005d000 fd:02 6291549                    /home/huangc/linux.x64/lib/libmc2_mcapi.so
7f27964d4000-7f27964d7000 rw-p 0005d000 fd:02 6291549                    /home/huangc/linux.x64/lib/libmc2_mcapi.so
7f27964d7000-7f2796530000 rw-p 00000000 00:00 0 
7f2796530000-7f2796542000 r-xp 00000000 fd:02 6293484                    /home/huangc/Lib/linux.x64/librm_msg.so
7f2796542000-7f2796742000 ---p 00012000 fd:02 6293484                    /home/huangc/Lib/linux.x64/librm_msg.so
7f2796742000-7f2796743000 rw-p 00012000 fd:02 6293484                    /home/huangc/Lib/linux.x64/librm_msg.so
7f2796743000-7f279675d000 r-xp 00000000 fd:02 6293517                    /home/huangc/Lib/linux.x64/libfsc_rmgateway.so
7f279675d000-7f279695d000 ---p 0001a000 fd:02 6293517                    /home/huangc/Lib/linux.x64/libfsc_rmgateway.so
7f279695d000-7f279695e000 rw-p 0001a000 fd:02 6293517                    /home/huangc/Lib/linux.x64/libfsc_rmgateway.so
7f279695e000-7f2796977000 r-xp 00000000 fd:02 6291539                    /home/huangc/linux.x64/lib/libfsc_router.so
7f2796977000-7f2796a76000 ---p 00019000 fd:02 6291539                    /home/huangc/linux.x64/lib/libfsc_router.so
7f2796a76000-7f2796a78000 rw-p 00018000 fd:02 6291539                    /home/huangc/linux.x64/lib/libfsc_router.so
7f2796a78000-7f2796a8c000 rw-p 00000000 00:00 0 
7f2796a8c000-7f2796a9f000 r-xp 00000000 fd:02 6293467                    /home/huangc/Lib/linux.x64/libfsc_warm_standby.so (deleted)
7f2796a9f000-7f2796c9e000 ---p 00013000 fd:02 6293467                    /home/huangc/Lib/linux.x64/libfsc_warm_standby.so (deleted)
7f2796c9e000-7f2796ca0000 rw-p 00012000 fd:02 6293467                    /home/huangc/Lib/linux.x64/libfsc_warm_standby.so (deleted)
7f2796ca0000-7f2796ce4000 r-xp 00000000 fd:02 6293558                    /home/huangc/Lib/linux.x64/librm3.so
7f2796ce4000-7f2796ee3000 ---p 00044000 fd:02 6293558                    /home/huangc/Lib/linux.x64/librm3.so
7f2796ee3000-7f2796ee6000 rw-p 00043000 fd:02 6293558                    /home/huangc/Lib/linux.x64/librm3.so
7f2796ee6000-7f2796f22000 r-xp 00000000 fd:02 6291528                    /home/huangc/linux.x64/lib/libfsc_filter_log.so
7f2796f22000-7f2797021000 ---p 0003c000 fd:02 6291528                    /home/huangc/linux.x64/lib/libfsc_filter_log.so
7f2797021000-7f2797024000 rw-p 0003b000 fd:02 6291528                    /home/huangc/linux.x64/lib/libfsc_filter_log.so
7f2797024000-7f27971d6000 r-xp 00000000 fd:00 1726189                    /usr/local/lib64/libcrypto.so.1.0.0
7f27971d6000-7f27973d6000 ---p 001b2000 fd:00 1726189                    /usr/local/lib64/libcrypto.so.1.0.0
7f27973d6000-7f27973fc000 rw-p 001b2000 fd:00 1726189                    /usr/local/lib64/libcrypto.so.1.0.0
7f27973fc000-7f27973ff000 rw-p 00000000 00:00 0 
7f27973ff000-7f279745f000 r-xp 00000000 fd:00 1726229                    /usr/local/lib64/libssl.so.1.0.0
7f279745f000-7f279765e000 ---p 00060000 fd:00 1726229                    /usr/local/lib64/libssl.so.1.0.0
7f279765e000-7f2797668000 rw-p 0005f000 fd:00 1726229                    /usr/local/lib64/libssl.so.1.0.0
7f2797677000-7f279769d000 rw-p 00000000 00:00 0 
7f279769d000-7f279769e000 rw-s 00000000 00:0f 31411401                   /dev/shm/warmstandby_hc#1.rmgateway
7f279769e000-7f27976a4000 r-xp 00000000 fd:02 6291526                    /home/huangc/linux.x64/lib/libfsc_f2security.so
7f27976a4000-7f27977a3000 ---p 00006000 fd:02 6291526                    /home/huangc/linux.x64/lib/libfsc_f2security.so
7f27977a3000-7f27977a4000 rw-p 00005000 fd:02 6291526                    /home/huangc/linux.x64/lib/libfsc_f2security.so
7f27977a4000-7f27977bf000 r-xp 00000000 fd:02 6291525                    /home/huangc/linux.x64/lib/libfsc_f2pack.so
7f27977bf000-7f27978be000 ---p 0001b000 fd:02 6291525                    /home/huangc/linux.x64/lib/libfsc_f2pack.so
7f27978be000-7f27978c0000 rw-p 0001a000 fd:02 6291525                    /home/huangc/linux.x64/lib/libfsc_f2pack.so
7f27978c0000-7f27978d2000 r-xp 00000000 fd:02 6291523                    /home/huangc/linux.x64/lib/libfsc_f2mproxy.so
7f27978d2000-7f27979d2000 ---p 00012000 fd:02 6291523                    /home/huangc/linux.x64/lib/libfsc_f2mproxy.so
7f27979d2000-7f27979d3000 rw-p 00012000 fd:02 6291523                    /home/huangc/linux.x64/lib/libfsc_f2mproxy.so
7f27979d3000-7f2797aec000 rw-s 00000000 00:0f 31411386                   /dev/shm/daemon_ctrl_share
7f2797aec000-7f2797afc000 r-xp 00000000 fd:02 6291519                    /home/huangc/linux.x64/lib/libfsc_f2daemon.so
7f2797afc000-7f2797bfc000 ---p 00010000 fd:02 6291519                    /home/huangc/linux.x64/lib/libfsc_f2daemon.so
7f2797bfc000-7f2797bfd000 rw-p 00010000 fd:02 6291519                    /home/huangc/linux.x64/lib/libfsc_f2daemon.so
7f2797bfd000-7f2797d7d000 rw-p 00000000 00:00 0 
7f2797d7d000-7f2797d96000 r-xp 00000000 fd:02 6291516                    /home/huangc/linux.x64/lib/libfsc_esbmsg.so
7f2797d96000-7f2797e95000 ---p 00019000 fd:02 6291516                    /home/huangc/linux.x64/lib/libfsc_esbmsg.so
7f2797e95000-7f2797e97000 rw-p 00018000 fd:02 6291516                    /home/huangc/linux.x64/lib/libfsc_esbmsg.so
7f2797e97000-7f2797eb3000 r-xp 00000000 fd:02 6291522                    /home/huangc/linux.x64/lib/libfsc_f2log.so
7f2797eb3000-7f2797fb3000 ---p 0001c000 fd:02 6291522                    /home/huangc/linux.x64/lib/libfsc_f2log.so
7f2797fb3000-7f2797fb4000 rw-p 0001c000 fd:02 6291522                    /home/huangc/linux.x64/lib/libfsc_f2log.so
7f2797fb4000-7f2797fcf000 r-xp 00000000 fd:00 1704802                    /usr/lib64/gconv/GBK.so
7f2797fcf000-7f27981ce000 ---p 0001b000 fd:00 1704802                    /usr/lib64/gconv/GBK.so
7f27981ce000-7f27981cf000 r--p 0001a000 fd:00 1704802                    /usr/lib64/gconv/GBK.so
7f27981cf000-7f27981d0000 rw-p 0001b000 fd:00 1704802                    /usr/lib64/gconv/GBK.so
7f27981d0000-7f279e061000 r--p 00000000 fd:00 1704750                    /usr/lib/locale/locale-archive
7f279e061000-7f279e08d000 r-xp 00000000 fd:00 1704799                    /usr/lib64/gconv/GB18030.so
7f279e08d000-7f279e28c000 ---p 0002c000 fd:00 1704799                    /usr/lib64/gconv/GB18030.so
7f279e28c000-7f279e28d000 r--p 0002b000 fd:00 1704799                    /usr/lib64/gconv/GB18030.so
7f279e28d000-7f279e28e000 rw-p 0002c000 fd:00 1704799                    /usr/lib64/gconv/GB18030.so
7f279e28e000-7f279e294000 rw-p 00000000 00:00 0 
7f279e294000-7f279e2a0000 r-xp 00000000 fd:02 6291517                    /home/huangc/linux.x64/lib/libfsc_f2config.so
7f279e2a0000-7f279e3a0000 ---p 0000c000 fd:02 6291517                    /home/huangc/linux.x64/lib/libfsc_f2config.so
7f279e3a0000-7f279e3a1000 rw-p 0000c000 fd:02 6291517                    /home/huangc/linux.x64/lib/libfsc_f2config.so
7f279e3a1000-7f279e3b7000 r-xp 00000000 fd:02 6291518                    /home/huangc/linux.x64/lib/libfsc_f2core.so
7f279e3b7000-7f279e4b7000 ---p 00016000 fd:02 6291518                    /home/huangc/linux.x64/lib/libfsc_f2core.so
7f279e4b7000-7f279e4b8000 rw-p 00016000 fd:02 6291518                    /home/huangc/linux.x64/lib/libfsc_f2core.so
7f279e4b8000-7f279e4b9000 rw-p 00000000 00:00 0 
7f279e4b9000-7f279e4c9000 r-xp 00000000 fd:02 6291545                    /home/huangc/linux.x64/lib/libf_os.so
7f279e4c9000-7f279e5c9000 ---p 00010000 fd:02 6291545                    /home/huangc/linux.x64/lib/libf_os.so
7f279e5c9000-7f279e5ca000 rw-p 00010000 fd:02 6291545                    /home/huangc/linux.x64/lib/libf_os.so
7f279e5ca000-7f279e5ce000 rw-p 00000000 00:00 0 
7f279e5ce000-7f279e5fc000 rw-p 00000000 00:00 0 
7f279e5fc000-7f279e603000 r--s 00000000 fd:00 1705008                    /usr/lib64/gconv/gconv-modules.cache
7f279e603000-7f279e604000 rw-p 00000000 00:00 0 
7ffffa45c000-7ffffa49c000 rw-p 00000000 00:00 0                          [stack]
7ffffa564000-7ffffa565000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
[huangc@V-02-01-00860 ~]$ 

三、vmstat

    前面“ CPU利用率” 一节中介绍过 vmstatvmstat的主要目的是监视内存可用性和交换活动,还可以提供 I/O活动的概况。 vmstat可协助发现异常的系统活动, 例如会导致操作系统性能下降的过多的页面错误或上下文切换操作。vmstat的输出样本如下所示 :
[huangc@V-02-01-00860 ~]$ vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 1  0 2648032 702872  67048 5155016    1    6     5    34    0    1 27 27 46  0  0

vmstat可以报告以下与内存相关的数据 :
  • memory部分的单位为 KB,显示被换出内存容量(swpd)、空闲内存容量(free)I/O数据结构的缓冲区缓存容量(buff),以及从磁盘读取文件时所用的内存缓存容量(cache)
  • swap部分显示从磁盘上换入的内存量(si)以及换出到磁盘上的内存量(so),单位为KB/sio部分显示从设备上读入的块数(bi)以及写出到设备上的块数(bo),单位为 KB/s
对于 I/O操作密集的工作负荷,可以监视 bibo来获取传输速率,监视 in来获取中断速率。可以通过监视 swpdsiso来查看操作系统是否正在执行交换活动,还可以再检查交换速率。最常见的量度也许是 CPU利用率以及对 ussyidwa的监视。如果wa取值很大, 则需要检查 I/O子系统, 结论有可能是需要更多的 I/O控制器和磁盘以便减少I/O等待时间 。

posted on 2016-10-12 17:27  胡永光  阅读(339)  评论(0编辑  收藏  举报

导航