Search
Varnish Cache Plus

Settings

Configuration key flags

Some configuration keys have flags associated with them. Their meanings are listed below.

required

The configuration key is required, and it is an error to not specify it.

persisted

The configuration key is persisted, and can not be changed without recreating the book.

Configuration key types

The following types of configuration keys exist, listed with its expected value format.

id

An identification string, maximum 16 characters long. Give the value in double quotes.

bytes

Value identifies a byte count. Give the value in double quotes. Accets k, m, g, t and p suffix.

string

Regular string. Give the value in double quotes.

bool

Boolean value. Accepts true or false, without quotes.

double

Floating point number. Give the value without quotes.

unsigned

Unsigned integer value. Give the value without quotes.

Environment configuration parameters

id

Environment id

  • Type: id
  • Flags: required

Symbolic ID of this environment.

memcache_size

Memory cache size

  • Type: bytes
  • Default: 1G
  • Minimum value: 4M

The number of bytes of memory to use for object storage in this environment.

memcache_chunksize

Memory cache chunk size

  • Type: bytes
  • Default: 4M
  • Minimum value: 4k

Maximum size of memory chunks allocated for object fragments. Also defines the size of AIO requests.

memcache_metachunksize

Memory cache meta chunk size

  • Type: bytes
  • Default: 4k
  • Minimum value: 4k

Target size of the memory chunk containing the meta data (object attributes including the object headers) of stored objects. This is an indication only, and if necessary a larger chunk will be used, up to memcache_chunksize. Any left over space will be used for object body data.

default_stores

Default store selection

  • Type: string

Specifies which stores will be selected if no specific store is selected in VCL (through the MSE VMOD). This functions in the same way as with mse.select_stores(), so it is legal to specify a book name, a store name, or a tag that is shared among any number of books and stores

varylib_tblsize

Varylib table size

  • Type: bytes
  • Default: 4k

Size of table chunk used for vary library

Book configuration parameters

id

Book id

  • Type: id
  • Flags: required

Symbolic ID of this book.

directory

Directory path for book storage

  • Type: string
  • Flags: required

Specifies the directory where the book’s data files should be stored.

database_size

Size of database

  • Type: bytes
  • Default: 1G
  • Minimum value: 100k

Size of the embedded database. Upon first initialization the storage file will be preallocated to this size. The size may be increased at a later stage by increasing this value and restarting Varnish. The storage file will then grow up to the new limit as needed. Decreasing the value will not have any effect.

database_readers

Number of simultaneous readers

  • Type: unsigned
  • Default: 4096
  • Minimum value: 126

Size of reader table for database readers. This defines the maximum number of simultaneous readers.

database_sync

Synchronize database to disk

  • Type: bool
  • Default: true

Synchronize the database to disk at the end of transactions. This enables transaction consistency also in the event of operating system or power failures. If these types of errors are not expected, one may turn off the synchronization to disk. When turned off, there will still be consistency with regard to the cached objects and cache invalidations in case of planned or unplanned restarts of the Varnish daemon.

database_insert_timeout

Database object insertion timeout

  • Type: double
  • Default: 0.1
  • Minimum value: 0
  • Maximum value: 1

Experimental: The maximum time to wait for database access on object insertion. If this timeout expires, the attempt is aborted, and the fetch is done as a memory only object instead (not persisted). Note: This parameter and the interface to control this behaviour is subject to change.

database_waterlevel

Database high waterlevel ratio

  • Type: double
  • Default: 0.9
  • Minimum value: 0.1
  • Maximum value: 0.99

The maximum fill level of the embedded database as a ratio. When this fill level is reached, new transactions are queued until the background worker thread has purged enough objects to get below the fill level again.

database_waterlevel_hysterisis

Database waterlevel hysterisis

  • Type: double
  • Default: 0.05
  • Minimum value: 0.0
  • Maximum value: 0.5

The embedded database fill level at which the dedicated worker thread to remove objects will be started, expressed as the ratio difference to the database waterlevel. When this level is reached, the background worker thread to purge objects is started, but transactions are not queued until the database waterlevel is reached.

database_waterlevel_snipecount

Waterlevel purge batch size

  • Type: unsigned
  • Default: 10
  • Minimum value: 1

Number of objects to snipe in each batch during database waterlevel purging.

banlist_size

Banlist journal size

  • Type: bytes
  • Default: 1M
  • Minimum value: 8192

The active bans on the system are stored in a journal file of this size. If the space is exhausted, they will bleed off into the embedded database.

Store configuration parameters

id

Book id

  • Type: id
  • Flags: required

Symbolic ID of this store.

filename

Storage file name

  • Type: string
  • Flags: required

The full path filename of the storage file that will hold the persisted objects.

size

Store size

  • Type: bytes
  • Default: 1G
  • Minimum value: 100k
  • Flags: persisted

The size of the store in bytes.

align

Store chunk alignment

  • Type: bytes
  • Default: 4k
  • Minimum value: 4k
  • Flags: persisted

Align all store allocations to multiples of this amount.

minfreechunk

Minimum size of a free chunk

  • Type: bytes
  • Default: 4k
  • Minimum value: 4k

The minimum size of a free store chunk to keep track of. Chunks smaller than this will instead be added to allocations as extra overhead.

aio_requests

Number of simultaneous AIO requests

  • Type: unsigned
  • Default: 128
  • Minimum value: 1
  • Maximum value: 65534

The number of concurrent AIO requests allowed. If exceeded, threads will be queued waiting for an AIO context to become available. Defines the concurrency against the system IO device.

aio_db_handles

Number of read only database handles set aside for the AIO

  • Type: unsigned
  • Default: 16
  • Minimum value: 1

The AIO subsystem will have this many read only database handles in a pool to use when needing to read metadata from the book. If exhausted the thread will be queued until a database handle becomes available.

aio_write_queue_overflow

Experimental: Do not store objects when write queue is too long

  • Type: bool
  • Default: true

When this option is enabled and more than aio_write_queue_overflow_len threads are already queued for write IO, then the store selection is overridden and the object becomes a memory only cached object. The object is still cached, and will live in the memory cache according to the normal rules, but will not be disk backed, and if removed through LRU eviction will have to be fetched again from the backend. Note: This parameter and the interface to control this behaviour is subject to change.

aio_write_queue_overflow_len

Experimental: Queue length at which to not store objects

  • Type: unsigned
  • Default: 1
  • Minimum value: 1

The AIO write queue length at which the store bypass option takes effect. Note: This parameter and the interface to control this behaviour is subject to change.

journal_size

Store metadata update journal size

  • Type: bytes
  • Default: 1M
  • Minimum value: 8192

Object metadata updates are temporarily stored in a journal file of this size, and applied to the embedded database as part of the next transaction. If the space is exhausted, additional database transactions are made to flush the journal.

waterlevel_painted

Fraction of store objects painted as candidates for waterlevel purge

  • Type: double
  • Default: 0.33
  • Minimum value: 0
  • Maximum value: 1

This fraction of the objects on the store LRU will be painted as candidates for waterlevel purge when there is too little space available for new objects in the cache. The painted objects are all eligeble for purging, and which object is purged is based on the location they occupy in the store so that continous free areas may be created.

waterlevel_threads

Number of waterlevel threads to use

  • Type: unsigned
  • Default: 1
  • Minimum value: 1

This scales the number of threads to use when purging objects to achieve the set waterlevel for the store. More threads will achieve more concurrency to reach the goal faster.

waterlevel_minchunksize

Minimum chunk size to include in the store waterlevel measurement

  • Type: bytes
  • Default: 512k
  • Minimum value: 16k

When calculating the current fill level of the store, only free chunks of at least this size is considered. This defines the level of fragmentation that is accepted, and chunks of this size and larger does not constitute unwanted fragmentation.

waterlevel

Store waterlevel

  • Type: double
  • Default: 0.9
  • Minimum value: 0.1
  • Maximum value: 0.99

The maximum fill level of the store given as a ratio of the store size. When this fill level is reached, attempts to allocate space for new objects will be queued until the waterlevel drops below this level.

waterlevel_hysterisis

Store waterlevel hysterisis

  • Type: double
  • Default: 0.05
  • Minimum value: 0.0
  • Maximum value: 0.5

The maximum fill level at which the background worker threads to purge objects and create continous free space are started. Expressend as the ratio difference to the store waterlevel. When the fill level drops below this level the background threads are paused.

waterlevel_snipecount

Store waterlevel purge batch size

  • Type: unsigned
  • Default: 10
  • Minimum value: 1

The number of objects each background purge thread will remove from the the cache in each step before remeasuring the fill level.