Chinaunix首页 | 论坛 | 博客
  • 博客访问: 869717
  • 博文数量: 192
  • 博客积分: 8554
  • 博客等级: 中将
  • 技术积分: 1892
  • 用 户 组: 普通用户
  • 注册时间: 2006-08-12 04:36
文章分类

全部博文(192)

文章存档

2012年(5)

2010年(27)

2009年(22)

2008年(42)

2007年(51)

2006年(45)

分类:

2007-04-24 15:54:53

注:本文是由韩老大提供的

Glance提取Memory使用率数据的命令:

 

echo 'print gbl_stattime, " Memory Usage=", GBL_MEM_UTIL' >temp

glance -adviser_only -syntax ./temp -j 5 > /tmp/*/* &

 

 

过程举例:

 

1.生成shell脚本

#vi /tmp/hanlong/1.sh

 

2.把一下内容拷贝到1.sh

 

echo 'print gbl_stattime, " Memory Usage=", GBL_MEM_UTIL' >temp

glance -adviser_only -syntax ./temp -j 5 > /tmp/hanlong/1.log &

 

3.赋予权限

#chmod 777 /tmp/hanlong/1.sh

 

4.执行脚本

#sh /tmp/hanlong/1.sh

 

5.查看记录

#more /tmp/hanlong/1.log

 

15:17:21 Memory Usage=  93.8

15:17:26 Memory Usage=  93.8

15:17:31 Memory Usage=  93.8

15:17:36 Memory Usage=  93.8

15:17:41 Memory Usage=  93.8

15:17:46 Memory Usage=  93.8

 

注意:

以上的内容需要根据你的实际情况进行修改,如目录、文件名。

还要注意在实际应用中考虑定期清空文件,以免生成文件过大。

 

GBL_MEM_UTIL解释

The percentage of physical memory in use during the interval.

This includes system memory(occupied by the kernel),buffer cache and user memory

 

阅读(1873) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~