malloc and caching misses

Tobias Honacker t.honacker at googlemail.com
Wed Jul 29 10:37:11 CEST 2015


Hi guys,

first of all we are using malloc 16G and varnish currently using > 25G of
our memory so the vm begin to swap. n_lru_nuked value raise up quickly.


  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
65265 nobody    20   0 27.3g  25g  81m S 12.3 82.2 463:09.42 varnishd

root      /usr/sbin/varnishd -P /var/run/varnish.pid -a 127.0.0.1:8080 -f
/etc/varnish/default.vcl -T 127.0.0.1:6082 -t 120 -S /etc/varnish/secret -s
malloc,16G
nobody  /usr/sbin/varnishd -P /var/run/varnish.pid -a 127.0.0.1:8080 -f
/etc/varnish/default.vcl -T 127.0.0.1:6082 -t 120 -S /etc/varnish/secret -s
malloc,16G

Further we cache our main site "/".
The first varnish proxy logs many cache misses on "/", the second varnish
proxy not.
I ran following command to monitor this behavior for ~20 minutes

varnishlog -g request -q "RespHeader eq 'X-Cache: MISS'" -i ReqUrl |grep
ReqURL | awk '{print $3}'

and the output is that varnish logs 432 cache misses on "/" using
beresp.ttl = 300s on that site.
Both configs (varnish 1 and varnish 2) are the same using puppet to publish
the configs.


Env:

varnishd (varnish-4.0.2 revision bfe7cd1)
Copyright (c) 2006 Verdens Gang AS
Copyright (c) 2006-2014 Varnish Software AS

Red Hat Enterprise Linux Server release 6.6 (Santiago)

User -> 2 keepalives -> 2 varnishes -> backend (tomcat)

VCL snippet:

sub vcl_recv:

if( req.url ~ "^/$") {

  return (hash);
}

return (pass);


sub vcl_backend_response:

if ((beresp.status == 200) && (beresp.http.Cache-Control ~ "max-age")) {
    return (deliver);
  }


Thanks,
Tobias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20150729/f9c129da/attachment.html>


More information about the varnish-misc mailing list