如何利用spotlight for unix对linux进行系统性能监控

 
 
首先要启动SSH
system-config-service将SSHD启动并设置为系统自动启动
一定要安装system-system tools下的sysstat包,以安装sar和iostat包(此包非默认安装)
然后连接spotlight即可
要注意的是spotlight显示出来的内存是不对的
原因如下:
spotlight利用vmstat命令的mem中的free作为空余内存
-bash-3.00$ vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa
 0  0    160 746116  50016  64124    0    0     2     2    3     2  2  1 96
linux的的内存分配类似于vista,会有一部分空闲内存作为buffer和cache
A buffer is something that has yet to be "written" to disk. A cache is something that has been "read" from the disk and stored for later use.
所以这里的free的内存并不是我们传统意义上的"free memory"
要想看真正的"free memory"
在linux下需要用如下命令
-bash-3.00$ free -m
             total       used       free     shared    buffers     cached
Mem:          1010        287        722          0         49         67
-/+ buffers/cache:        170        839
Swap:         2047          0       2047
 
FREE命令参考
free
free 命令相对于top 提供了更简洁的查看系统内存使用情况:
$ free
total used free shared buffers cachedMem: 255268 238332 16936 0 85540 126384-/+ buffers/cache: 26408 228860Swap: 265000 0 265000
Mem:表示物理内存统计
-/+ buffers/cached:表示物理内存的缓存统计
Swap:表示硬盘上交换分区的使用情况,这里我们不去关心。
系统的总物理内存:255268Kb(256M),但系统当前真正可用的内存b并不是第一行free 标记的 16936Kb,它仅代表未被分配的内存。
我们使用total1、used1、free1、used2、free2 等名称来代表上面统计数据的各值,1、2 分别代表第一行和第二行的数据。
total1:表示物理内存总量。
used1:表示总计分配给缓存(包含buffers 与cache )使用的数量,但其中可能部分缓存并未实际使用。
free1:未被分配的内存。
shared1:共享内存,一般系统不会用到,这里也不讨论。
buffers1:系统分配但未被使用的buffers 数量。
cached1:系统分配但未被使用的cache 数量。buffer 与cache 的区别见后面。
used2:实际使用的buffers 与cache 总量,也是实际使用的内存总量。
free2:未被使用的buffers 与cache 和未被分配的内存之和,这就是系统当前实际可用内存。
可以整理出如下等式:
total1 = used1 + free1total1 = used2 + free2used1 = buffers1 + cached1 + used2free2 = buffers1 + cached1 + free1
buffer 与cache 的区别

你可能感兴趣的:(linux,unix,Spotlight,休闲,系统性能监控)