buffer vs. cache

来源:互联网 发布:nagios在linux行业方面 编辑:程序博客网 时间:2024/06/06 00:16

In order to make clear about the difference between “buffers and cached” from the ‘top’ result, here are the operations and observations, the server is of about 50G memory.


1.    cat /dev/vg00/lvol8 >/dev/null
buffers increased about 10G, while cached doesn’t change.
 
2.    cat /dev/vg00/lvol8 >/dev/null (again)
buffers and cached doesn’t change
 
3.    dd if=/dev/zero of=test.data bs=10M count=1000
cached increased about 10G, while buffers doesn’t change.
 
4.    cp test.data test.1
cached increased another 10G, while buffers doesn’t change.
 
5.    rm test.1
cached decreased about 10G and free memory increased 10G.
 
6.    cat bigfile.txt >/dev/null
cached increased about 1G (size of bigfile).

 

参考:

http://www.lupaworld.com/home-space-do-blog-uid-56821-id-149454.html