Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2294317
  • 博文数量: 276
  • 博客积分: 5998
  • 博客等级: 大校
  • 技术积分: 5175
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-24 14:43
文章分类

全部博文(276)

文章存档

2014年(25)

2013年(11)

2012年(69)

2011年(167)

2010年(4)

分类: LINUX

2011-07-24 00:42:08

 

 

1、Swappiness

Swappiness is a property for the that changes the balance between swapping out runtime memory, as opposed to dropping pages from the system . Swappiness can be set to values between 0 and 100 inclusive. A low value means the kernel will try to avoid swapping as much as possible where a higher value instead will make the kernel aggressively try to use swap space. The default value is 60, and for most desktop systems, setting it to 100 may help to improve overall performance, whereas setting it lower (even 0) may improve interactivity (decreasing response latency.)

To temporarily set the swappiness in Linux, as root you set the value to 100 with the following command:

echo 100 > /proc/sys/vm/swappiness
 
2、swap_token_timeout

This file contains valid hold time of swap out protection token. The Linux VM has token based thrashing control mechanism and uses the token to prevent unnecessary page faults in thrashing situation. The unit of the value is second. The value would be useful to tune thrashing behavior.

This tunable was removed in 2.6.20 when the algorithm got improved.

I tested the patch on an IA-32 4 way machine which has 4GB memory. Based kernel was 2.6.9-rc1. I tested five swap_token_time_out values. I created 256 workload generation processes on the machine. Each process generated same workload: repeating random file writing and memory access (Memory region is 18MB). I ran the processes for one hour and calculated write throughput of workload processes. The result was following. swap_token_time_out Write throughput [MB/s] ------------------- ---------------------- 30,000,000 6.71 3,000,000 8.26 300,000 (DEFAULT) 7.90 30,000 8.16 3,000 7.43 As you can see, it may be possible to improve application performance according to tune swap_token_time_out. Additionally, I think it is better to decrease default value. One reason is that the other values gained good performance. The other is that behavior of kernel may be unstable if swap_token_time_out is too long. More majordomo info at Please read the FAQ at

阅读(2599) | 评论(0) | 转发(0) |
0

上一篇:用shell连接数据

下一篇:2.6 swapping behavior

给主人留下些什么吧!~~