Skip to content

Instantly share code, notes, and snippets.

@wkhayrattee
Forked from ThijsFeryn/varnish.service
Created May 13, 2020 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wkhayrattee/8d5cbf197c618119adf9ca23c9b07b50 to your computer and use it in GitHub Desktop.
Save wkhayrattee/8d5cbf197c618119adf9ca23c9b07b50 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