Skip to main content

Service

Service Settings

By default, 512MB of data can be stored in the memory. You should consider increasing the value if you have many sites on the server or sites with many pages.

To give Varnish Cache more memory, do the following:

  1. Login via SSH as root user.

  2. Open the systemd service file:

nano /lib/systemd/system/varnish.service
  1. Increase the malloc value from 512m e.g. to 2048m:
ExecStart=/usr/sbin/varnishd \
          -a :6081 \
          -f /etc/varnish/default.vcl \
          -P %t/%N/varnishd.pid \
          -p feature=+http2 \
          -p http_resp_hdr_len=40000 \
          -s malloc,512m
  1. Reload systemd manager configuration:
systemctl daemon-reload
  1. Restart the Varnish Cache Service:
systemctl restart varnish

Configuration File

The Varnish Cache Configuration File can be found at:

/etc/varnish/default.vcl

After making changes, you need to reload the configuration.

  1. Login via SSH as root user.

  2. Run varnishreload to use the new compiled vlc configuration:

varnishreload