最近,我注意到我的一个服务器的kern.log中的这样的条目:
Feb 16 00:24:05 aramis kernel: swapper: page allocation failure. order:0,mode:0x20
我想知道:
>这条消息到底意味着什么?
>我的服务器内存不足吗?
交换使用率非常低(低于10%),到目前为止,我没有注意到由于内存不足而导致任何进程被杀死.
附加信息:
>服务器是运行Debian 6.0的Xen实例(DomU)
>它有512 MB的RAM和512 MB的交换分区
>虚拟机内的cpu负载平均显示为0.25
解决方法
Debian bug 666021似乎是同一个问题的报告.建议有:
#change value for this boot sysctl -w vm.min_free_kbytes=65536 #change value for subsequent boots echo "vm.min_free_kbytes=65536" >> /etc/sysctl.conf
http://russ.garrett.co.uk/2009/01/01/linux-kernel-tuning/讨论了何时更改此设置可能有用,转载于此处:
This tells the kernel to try and keep 64MB of RAM free at all times.
It’s useful in two main cases:
Swap-less machines,where you don’t want incoming network traffic to overwhelm the kernel and force an OOM before it has time to flush
any buffers.x86 machines,for the same reason: the x86 architecture only allows DMA transfers below approximately 900MB of RAM. So you can end
up with the bizarre situation of an OOM error with tons of RAM free.
我在3.2.12-gentoo x86机器上应用了这个设置,但我仍然遇到这些错误.