Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
9ed7ae73
Commit
9ed7ae73
authored
Feb 27, 2013
by
Per Buer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage
parent
850f1165
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
119 additions
and
4 deletions
+119
-4
storage-backends.rst
doc/sphinx/users-guide/storage-backends.rst
+119
-4
No files found.
doc/sphinx/users-guide/storage-backends.rst
View file @
9ed7ae73
Storage backends
----------------
Intro
~~~~~
Varnish has pluggable storage backends. It can store data in various
backends which have different performance characteristics.
When you configure Varnish you need to give it some place to store
data. Varnish has pluggable storage backends. It can store data in
various backends which have different characteristics with regards to
semantics and performance.
malloc
~~~~~~
syntax: malloc[,size]
Malloc is a memory based backend. Each object will be allocated from
memory. If your system runs low on memory swap will be used. Be aware
that the size limitation only limits the actual storage and that
approximately 1k of memory per object will be used for various
internal structures.
The size parameter specifies the maximum amount of memory varnishd
will allocate. The size is assumed to be in bytes, unless followed by
one of the following suffixes:
K, k The size is expressed in kibibytes.
M, m The size is expressed in mebibytes.
G, g The size is expressed in gibibytes.
T, t The size is expressed in tebibytes.
The default size is unlimited.
Mallocs performance is bound by memory speed so it is very fast. If
the dataset is bigger than what can fit in memory performance will
depend on the operating system and how well it doesn paging.
file
~~~~
syntax: file[,path[,size[,granularity]]]
The file backend stores objects in memory backed by a file on disk
with mmap. This is the default storage backend and unless you specify
another storage this one will used along with Transient storage.
The path parameter specifies either the path to the backing file or
the path to a directory in which varnishd will create the backing
file. The default is /tmp.
The size parameter specifies the size of the backing file. The size
is assumed to be in bytes, unless followed by one of the following
suffixes:
K, k The size is expressed in kibibytes.
M, m The size is expressed in mebibytes.
G, g The size is expressed in gibibytes.
T, t The size is expressed in tebibytes.
% The size is expressed as a percentage of the free space on the
file system where it resides.
The default size is 50%.
If the backing file already exists, it will be truncated or expanded
to the specified size.
Note that if varnishd has to create or expand the file, it will not
pre-allocate the added space, leading to fragmentation, which may
adversely impact performance on rotating hard drives. Pre-creating
the storage file using dd(1) will reduce fragmentation to a minimum.
The granularity parameter specifies the granularity of
allocation. All allocations are rounded up to this size. The
is assumed to be in bytes, unless followed by one of the
suffixes described for size except for %.
The default size is the VM page size. The size should be reduced if
you have many small objects.
File performance is typically limited by the write speed of the
device, and depending on use, the seek time.
persistent (experimental)
~~~~~~~~~~~~~~~~~~~~~~~~~
syntax: persistent,path,size {experimental}
Persistent storage. Varnish will store objects in a file in a manner
that will secure the survival of *most* of the objects in the event of
a planned or unplanned shutdown of Varnish.
The path parameter specifies the path to the backing file. If
the file doesn't exist Varnish will create it.
The size parameter specifies the size of the backing file. The
size is assumed to be in bytes, unless followed by one of the
following suffixes:
K, k The size is expressed in kibibytes.
M, m The size is expressed in mebibytes.
G, g The size is expressed in gibibytes.
T, t The size is expressed in tebibytes.
Varnish will split the file into logical *silos* and write to the
silos in the manner of a circular buffer. Only one silo will be kept
open at any given point in time. Full silos are *sealed*. When Varnish
starts after a shutdown it will discard the content of any silo that
isn't sealed.
.. include:: ../include/storage_backends.rst
Transient Storage
-----------------
If you name any of your storage backend "Transient" it will be
used for transient (short lived) objects. By default Varnish
would use an unlimited malloc backend for this.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment