Docgyan
Docgyan

Reputation: 685

How to store the Varnish cache content on local storage? and load to RAM once the Varnish service restarts

I am trying to implement a way to store the cache content on local storage and automatically loads to RAM if the Varnish service restarts for any reason. Kindly suggest if we have any way to do so.

Upvotes: 0

Views: 766

Answers (1)

Thijs Feryn
Thijs Feryn

Reputation: 4808

The only way to load persisted cache storage into Varnish is by using Varnish Enterprise's Massive Storage Engine.

Unfortunately, this is not possible with the open source version of Varnish.

See https://docs.varnish-software.com/varnish-cache-plus/features/mse/ for more information about the Massive Storage Engine (MSE).

The idea is that metadata is stored in a specific database that MSE provides. This concept is called "the book".

Every "book" has multiple "stores", which are large pre-allocated files containing the persisted cache storage.

When you recover both "books" and "stores", Varnish Enterprise will be able to reload the cache from these files.

If these files contain gigabytes or terabytes of data, MSE will be clever enough to only load the "hot" objects into memory.

Upvotes: 1

Related Questions