全部博文(113)
分类: 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.
chinaunix网友2011-03-06 16:13:42
很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com