Skip to content

Instantly share code, notes, and snippets.

@alexindigo
Created December 26, 2011 09:14
Show Gist options
  • Save alexindigo/1520795 to your computer and use it in GitHub Desktop.
Save alexindigo/1520795 to your computer and use it in GitHub Desktop.
Varnish upstart script
description "varnish daemon"
start on runlevel [2345]
stop on shutdown
expect fork
exec /usr/local/sbin/varnishd -f /usr/local/etc/varnish/default.vcl -s malloc,64MB -T 127.0.0.1:2000
respawn
@joshgoebel
Copy link

What about this stuff from the actual Debian/Ubuntu init.d starter:



# Open files (usually 1024, which is way too small for varnish)
ulimit -n ${NFILES:-131072}

# Maxiumum locked memory size for shared memory log
ulimit -l ${MEMLOCK:-82000}

Doesn't seem your upstart takes any of that into consideration?

@alexindigo
Copy link
Author

Thanx for the suggestion, I'm still in the dev mode, so it's good enough.
I'll take it into consideration for the prod setup.

@cgtx
Copy link

cgtx commented Sep 10, 2013

You can do this with the limits stanza.

limit nofile 131072 131072
limit memlock 82000 82000

http://upstart.ubuntu.com/wiki/Stanzas#limit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment