Chinaunix首页 | 论坛 | 博客
  • 博客访问: 562368
  • 博文数量: 44
  • 博客积分: 5017
  • 博客等级: 大校
  • 技术积分: 508
  • 用 户 组: 普通用户
  • 注册时间: 2006-10-17 16:03
文章分类

全部博文(44)

文章存档

2011年(1)

2010年(1)

2009年(1)

2008年(5)

2007年(22)

2006年(14)

我的朋友

分类: LINUX

2007-03-23 20:24:37

问题描述:  
    通过free查看时,大概有一半以上的物理内存分配到cache里面,这样大的 cache是造成内存的耗尽缘由,与此同时使用top或ps查看进程时,kswapd进程负荷 很高,一般在90%以上,kswapd进程的作用是用于内存回收,确保系统空闲物理内 存的数量在一个合适的范围,它是按照一定比率来回收系统当前不活动的内存(默 认的比率是5%),也就是cache和buffer占用的。
    在红旗4.0或4.1服务器版本(小于2.4.21-9.30的内核应该都存在这个问题)上安装数据库或OA应用出现机率比较高,因 为这些应用有大量的数据需要在内存和硬盘之间交换,这应该属于内核的一个 BUG,在4.1上打上SP1的补丁就不会有这种情况了。

解决方案:

  将inactive_clean_percent 的值由缺省的5调整到 100,这样做的目的就是设置kswapd回收内存的比率为100%,具体做法是:
  # echo 100 > /proc/sys/vm/inactive_clean_percent


    如果能解决问题,最好把的这条命令加到rc.local里面。
阅读(7050) | 评论(4) | 转发(0) |
给主人留下些什么吧!~~

holmes862008-06-22 18:44:46

你可以尝试这个方法:echo 1 > /proc/sys/vm/drop_caches 关于这个文件的解释如下: Writing to this will cause the kernel to drop clean caches, dentries and inodes from memory, causing that memory to become free. To free pagecache: * echo 1 > /proc/sys/vm/drop_caches To free dentries and inodes: * echo 2 > /proc/sys/vm/drop_caches To free pagecache, dentries and inodes: * echo 3 > /proc/sys/vm/drop_caches As this is a non-destructive operation, and dirty objects are not freeable, the use

chinaunix网友2008-04-08 11:59:53

我的版本是redhat as4.3,也存在kswapd这样的问题,也是找不到这个文件,请问有什么办法?