Memory usage
Darryl Dixon - Winterhouse Consulting
darryl.dixon at winterhouseconsulting.com
Wed Jan 27 05:07:11 CET 2010
> Thanks Darryl!
>
> One follow-up about the VIRT size (mine is 55.2GB). I thought the VIRT
> size
> includes the entire amount of VARNISH_STORAGE_SIZE (50GB in my case),
> regardless of how much of the virtual memory is actually being used to
> store cached objects. This seems to be the case based on a few minutes of
> experimenting with that setting.
That is correct. I was assuming from your initial post (probably wrongly)
that your cache was 'full' ie, that there were in your case 50GB of
objects cached already. You can see how much of the allocated cache is
used with varnishstat; the "bytes allocated" and "bytes free" row will
tell you this. Unfortunately, what you want is the intersection of "bytes
allocated" and "bytes not currently in physical memory" and if the entire
cache is not full, then it gets pretty tough to know, because Varnish *by
design* neither knows nor cares about the OSes swapping arrangements.
> o I'm not sure I understand how to
> determine the amount of virtual memory I'm actually using -- in other
> words, the amount of RAM I need to add for optimal performance -- from
> the VIRT and RES numbers alone. Any chance I could ask you to please fill
> in what I'm missing?
Probably the two entries from the varnishstat output I mentioned above
will give you a better idea. Obviously, if you really have 50GB of items
to cache, then you will need a lot of RAM. Perhaps if you monitor the
"bytes allocated" row over time you will see it stabilise - this is the
amount of RAM that you would need to keep all your cacheable items in
physical memory.
Of course, just because something ends up in the cache once, doesn't mean
there is necessarily any value in keeping it in physical memory; if no-one
ever requests it again, then it makes sense for it to end up in swap...
regards,
Darryl Dixon
Winterhouse Consulting Ltd
http://www.winterhouseconsulting.com
More information about the varnish-misc
mailing list