~ubuntu-branches/debian/sid/varnish/sid

« back to all changes in this revision

Viewing changes to doc/sphinx/=build/html/_sources/tutorial/sizing_your_cache.txt

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2011-10-29 15:23:24 UTC
  • mfrom: (0.1.15)
  • Revision ID: package-import@ubuntu.com-20111029152324-tdtlsurrv22ysknj
Tags: 3.0.2-1
* New upstream release
* Build from upstream tarball instead of git tag
* debian/watch: more specific regular expression

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
Sizing your cache
 
3
-----------------
 
4
 
 
5
Picking how much memory you should give Varnish can be a tricky
 
6
task. A few things to consider:
 
7
 
 
8
 * How big is your *hot* data set. For a portal or news site that
 
9
   would be the size of the front page with all the stuff on it, and
 
10
   the size of all the pages and objects linked from the first page. 
 
11
 * How expensive is it to generate an object? Sometimes it makes sense
 
12
   to only cache images a little while or not to cache them at all if
 
13
   they are cheap to serve from the backend and you have a limited
 
14
   amount of memory.
 
15
 * Watch the n_lru_nuked counter with :ref:`reference-varnishstat` or some other
 
16
   tool. If you have a lot of LRU activity then your cache is evicting
 
17
   objects due to space constraints and you should consider increasing
 
18
   the size of the cache.
 
19
 
 
20
Be aware that every object that is stored also carries overhead that
 
21
is kept outside the actually storage area. So, even if you specify -s
 
22
malloc,16G varnish might actually use **double** that. Varnish has a
 
23
overhead of about 1k per object. So, if you have lots of small objects
 
24
in your cache the overhead might be significant.
 
25