[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Fwd: Re: Buffers VS Page Cache

In <201102131521.18065.bss@iguanasuicide.net>, Boyd Stephen Smith Jr. wrote:
>Both types of memory are effectively free.  Cache can be dropped
>willy-nilly. Buffers can be reclaimed by waiting for their I/O to complete.
> Both of these actions are done automatically by the kernel when
>application memory pressure increases.

The choice to drop caches, wait on buffers, or swap out application memory is 
controlled by /proc/sys/vm/swappiness.  A value of 100 means "always" swap out 
application memory.  A value of 0 means "always" wait on buffers or drop 
caches.  I use a value of 1, the default is 60.  There was at one point a 
patch to let the kernel auto-tune this value based on current memory usage, 
but I don't know if it ever got mainlined, or if it gave measurable gains.

Since the cost of the "wrong" decision is mostly the same (read a page from 
swap or read a page from disk) it would seem, IMVHO, that it is more important 
to swap/drop the LRU/LFU page independent of whether that is applications 
memory or cache/buffers.
Boyd Stephen Smith Jr.                   ,= ,-_-. =.
bss@iguanasuicide.net                   ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy         `-'(. .)`-'
http://iguanasuicide.net/                    \_/

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply to: