Skip to content

Instantly share code, notes, and snippets.

@ThijsFeryn
Created May 13, 2020 12:01
Show Gist options
  • Save ThijsFeryn/2c4913b96a428cfbd8cde15c03fa12b3 to your computer and use it in GitHub Desktop.
Save ThijsFeryn/2c4913b96a428cfbd8cde15c03fa12b3 to your computer and use it in GitHub Desktop.
varnish systemd service
[Unit]
Description=Varnish Cache Plus, a high-performance HTTP accelerator
After=network-online.target
[Service]
Type=forking
KillMode=process
# Maximum number of open files (for ulimit -n)
LimitNOFILE=131072
# Locked shared memory - should suffice to lock the shared memory log
# (varnishd -l argument)
# Default log size is 80MB vsl + 1M vsm + header -> 82MB
# unit is bytes
LimitMEMLOCK=85983232
# Enable this to avoid "fork failed" on reload.
TasksMax=infinity
# Maximum size of the corefile.
LimitCORE=infinity
# Maximum number of threads (for ulimit -u)
LimitNPROC=infinity
ExecStart=/usr/sbin/varnishd -a http=:80,HTTP -a proxy=:8443,PROXY -S /etc/varnish/secret -T localhost:6082 -f /etc/varnish/default.vcl -s malloc,256m
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment