Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1132263
  • 博文数量: 113
  • 博客积分: 2422
  • 博客等级: 大尉
  • 技术积分: 1393
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-25 17:54
文章分类
文章存档

2016年(1)

2014年(8)

2013年(7)

2012年(13)

2011年(42)

2010年(26)

2009年(6)

2008年(6)

2007年(4)

我的朋友

分类: LINUX

2011-02-22 16:03:45

linux kernel parameter clear buffer cached

There is a "more end user like" way to handle this and it's there because how it is designed in the kernel sources is implemented as what is the assumed best for each user but for a lot of people this isn't the best. Sun (now Oracle) in fact suggests ways to tune the VM (Virtual Memory) usage on Linux for when you install items such as their databases but this can apply to all sorts of things. Also, not everything I suggest had the same option when these posts were submitted however they were available under different names.

To change how much the swap is used, run: sysctl -w vm.swappiness=X
replace X with an int between 0 and 100. 0 means only use swap when their are no other options and 100 means use swap as often as possible.

To make sure you always have X amount of Ram available (in kilobytes), run: sysctl -w vm.min_free_kbytes=X

To empty the page cache and the dirty write buffers with all committed transactions, run: sync && sysctl -w vm.drop_caches=3

vm.drop_caches is a command and not a tunable however the other ones can be stored in /etc/sysctl.conf and automatically set each time the system boots. There are many more options to explore for tuning VM and I would encourage you to read sysctl/vm.txt.gz in the Linux kernel source Documentation folder.

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

chinaunix网友2011-03-06 16:13:42

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com