Search
Varnish Enterprise

Introduction Installation Upgrading Troubleshooting Changelog Changelog for 6.0.x Changes (Varnish Cache 4.1) Changes (Varnish Cache Plus 4.1) Known Issues Features Backend SSL/TLS Client SSL/TLS termination Cluster In-Process TLS MSE 4 Basic Configuration / Getting Started Configuration Persisted caching Categories Configuration Reference MSE 3.0 Settings mkfs.mse Memory Governor MSE 2.0 NUMA Parallel ESI Backend health counter HTTP/2 Support JSON Logging TCP Only Probes Timeouts Transit Buffer Varnish scoreboard VMODs Accept Accounting ACL (aclplus) ActiveDNS Akamai Connector AWS VCL Body Access & Transformation (xbody) Brotli Cookie Plus (cookieplus) DeviceAtlas DeviceAtlas3 Digest Dynamic backends (goto) Edgestash File Format Geolocation (geoip/mmdb) Header Manipulation (headerplus) HTTP communication (http) Image JSON parsing (json) JWT Key value storage (kvstore) Least connections director (leastconn) Module to control the built-in HTTP2 transport (h2) MSE control (mse) MSE4 control (mse4) Probe Proxy ProxyV2 TLV Attribute Extraction (proxy) Pseudo Random Number Generator Purge (purge/softpurge) Real-time Status (rtstatus) Reverse DNS (resolver) Rewrite S3 VMOD Session Slicer SQLite3 Stale Standard (std) Stat (Prometheus) Strings (str) Synthetic backends (synthbackend) Tag-based invalidation (Ykey/Xkey) TCP configuration (tcp) TLS Total Encryption (crypto) Unified director object (udo) Uniform Resource Identifier (uri) Unix Socket Utilities (unix) URL Plus (urlplus) Utils Vsthrottle

MSE 1.0

Varnish 4.0

Massive Storage Engine 1.0

Description

Varnish Massive Storage Engine 1.0 (MSE or MSE1) is an improved storage backend for Varnish. It is a replacement for the original malloc and file storage backends. Main improvements are decreased disk IO load and lower storage fragmentation.

MSE is designed and tested with storage sizes up to 10 TB, but expected to work on far larger workloads.

Availability

MSE1 is available in Varnish Enterprise 4.0 from 4.0.2r1 and newer. In Varnish Cache Plus 4.1 MSE1 has been replaced by MSE2.

Installation

MSE is built into supported Varnish Enterprise versions, and does not need additional installation steps.

Configuration

MSE is configured in the same way that the file storage backend is:

varnishd -s mse,<file>,<size>[,<segments>]

It expects a data file path on disk and what size it should be. Number of storage segments can be left out.

MSE introduces a set of new parameters:

mse_bigalloc               1M [bytes] (default)
mse_delay_writes           on [bool] (default)
mse_membuf_size            4 [pages] (default)
mse_minextfree             4k [bytes] (default)
mse_nuke_limit             10 (default)
mse_pad_writes             on [bool] (default)
mse_prune_factor           2 (default)
mse_prune_loop             10 (default)
mse_sendfile_min           0b [bytes] (default)

It is recommended to keep these at the default values, with the exception of mse_bigalloc. This parameter should be as large as the bigger objects cached, for example 5MB for HTTP Live Streaming setups.

Advanced configuration

Using multiple stores

Using multiple storage segments is possible. For example it can be beneficial to use malloc storage (standard) for normal objects, and MSE for special objects.

This can be done through setting explicit storage in vcl_backend_response, and giving each storage defined on the command line a name:

varnishd -s memory=malloc,1G -s msestorage=mse,/var/lib/varnish/mse,100G

Example VCL:

# Note: advanced usage
sub vcl_backend_response {
	set beresp.storage_hint = "memory";
	if (bereq.url ~ ".mp4$") {
		set beresp.storage_hint = "msestorage";
	}
}

Number of MSE segments

Number of storage segments within MSE can be set on the command line.

Increasing it reduces lock contention when doing memory allocations, especially when forcefully expunging content is necessary.

See the varnishd manual pages for more information on tuning this parameter for big cache sizes.


®Varnish Software, Wallingatan 12, 111 60 Stockholm, Organization nr. 556805-6203