Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not limit locked memory by default #176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions systemd/varnish.service
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ KillMode=mixed
# Maximum number of open files (for ulimit -n)
LimitNOFILE=131072

# Shared memory (VSM) segments are tentatively locked in memory. The
# default value for vsl_space (or shorthand varnishd -l option) is 80MB.
# There are other types of segments that would benefit from allowing
# more memory to be locked.
LimitMEMLOCK=100M
# Shared memory (VSM) segments are tentatively locked in memory.
#
# Varnish will only lock memory in useful ways, so applying an external limit is
# not helpful.
LimitMEMLOCK=infinity

# Enable this to avoid "fork failed" on reload.
TasksMax=infinity
Expand Down
5 changes: 2 additions & 3 deletions sysv/debian/varnish.default
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ START=yes
NFILES=131072

# Maximum locked memory size (for ulimit -l)
# Used for locking the shared memory log in memory. If you increase log size,
# you need to increase this number as well
MEMLOCK=82000
# Not limited by default
MEMLOCK=unlimited

DAEMON_OPTS="-a :6081 \
-f /etc/varnish/default.vcl \
Expand Down
4 changes: 2 additions & 2 deletions sysv/debian/varnish.init
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ fi
# 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}
# Do not limit locked memory
ulimit -l ${MEMLOCK:-unlimited}

# If $DAEMON_OPTS is not set at all in /etc/default/varnish, use minimal useful
# defaults (Backend at localhost:8080, a common place to put a locally
Expand Down
2 changes: 1 addition & 1 deletion sysv/redhat/varnish.initrc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ start() {
ulimit -n ${NFILES:-131072}

# Varnish wants to lock shared memory log in memory.
ulimit -l ${MEMLOCK:-82000}
ulimit -l ${MEMLOCK:-unlimited}

# Maximum number of threads (default in CentOS is 1024, which
# is often too small for varnish)
Expand Down
4 changes: 2 additions & 2 deletions sysv/redhat/varnish.sysconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
NFILES=131072

# Locked shared memory (for ulimit -l)
# Default log size is 82MB + header
MEMLOCK=82000
# Default is unlimited
MEMLOCK="unlimited"

# Maximum number of threads (for ulimit -u)
NPROCS="unlimited"
Expand Down