Varnish malloc + swap

Reinis Rozitis r at roze.lv
Mon Sep 12 02:22:36 CEST 2016


> I have changed kernel parameters for memory/swap usage but this is still 
> occuring.

Just to check (if it's linux even), does this also include vm.swappiness = 0 
?
Though my own experience with older kernels is that once swap is taken it 
might never be released unless a manual swapoff is performed.


> Any pointers to links, or wisdom learnt from experience is welcomed :)

Is there a reason you need swap at all?
In my mind it makes no sense having a swap on a 48G system. Even more if it 
(as it seems) is dedicated for a single service.

It takes just a bit (start with less and see at which point the ram usage 
stops growing) to tune the malloc setting so the varnish uses all the 
available ram optimally and the OOM killer doesn't kick in.

p.s. also when making bigger caches than physical memory I have had much 
better results (on 3.0.x at least) instead of 'malloc' having a 'file' 
backend (on swapless systems) and relying on linux page cache rather than 
swap.

rr 




More information about the varnish-misc mailing list