varnish 2.1.5 memory and swap

Hettwer, Marian mhettwer at
Thu May 26 11:29:09 CEST 2011

On 25.05.11 22:04, "David Birdsong" <david.birdsong at> wrote:

>On Wed, May 25, 2011 at 2:05 AM, Hettwer, Marian
><mhettwer at> wrote:
>>Okay, I just ignore Virtual and have a look at Resistent.
>> If I understood Stig correct, the behaviour of varnish is expected.
>> 7,2GB RES mem, although malloc 6G was configured.
>> I can live with that :)
>> Still it's kinda odd, that Linux starts swapping out stuff, although RAM
>> would have been sufficient. The machine has 8 gig ram and varnishd is
>> using 7,2 gig.
>> Linux decided to use nearly 1GB of swap.
>> I hope that I can stop the kernel doing this by adding
>> Let's see. If that doesn't do the trick, it seems that I have to lower
>> malloc 6G.
>Check out cat /proc/sys/vm/min_free_kbytes; it's probably trying to
>maintain that level.

That's valuable information. Thanks!

>Also, kswapd will run through malloc'd address spaces looking for
>inactive pages to flush to the swap partition/file. So you may have
>loaded a bunch of objects into the address space by pulling them
>through varnish, but kswapd may decide that the object storage portion
>of the address space is swap'able since they're not actively written
>to (or read from?).

Quite possible. The question to me would be, when does kswapd decide
whether some pages are swapable?
After which time of inactivity with regards to reads/writes.

I suspected a behaviour like that. Thanks for pointing out that kswapd
would make the decision.
I believe from here I can go with educating myself. (reads: "Enjoying" the
fine "documentation" of Linux internals *SCNR*).

Thanks again to all! :)


More information about the varnish-misc mailing list