10

I have just installed varnish and its ready to serve web pages.

Problem is that we are hitting open files limit.
We have already set ulimit to varnish user.

We want to find a file where we can write this configuration:

# Maximum number of open files
NFILES=131072

# Locked shared memory, default log size is 82MB + header
MEMLOCK=82000

## Configuration with VCL
#
# Listen on port 80, administration on localhost:6082, and forward to
# one content server selected by the vcl file, based on the request.  Use a
# fixed-size cache file.
#
# Note: you must replace "example.org" with the outside IP address of your server
# - this is the address at which Varnish receives incoming requests.
# $wgSquidServers in MediaWiki's LocalSettings.php will also need to list all addresses for this Varnish cache.
#
DAEMON_OPTS="-a example.org:80 \
             -T localhost:6082 \
             -f /etc/varnish/default.vcl \
             -u varnish -g varnish \
             -s file,/var/lib/varnish/varnish_storage.bin,4G"
oers
  • 18,436
  • 13
  • 66
  • 75
khizar ansari
  • 1,476
  • 2
  • 18
  • 29

4 Answers4

30

The file you're looking for is the Varnish daemon config script. You can find this (usually) in the /etc/sysconfig/varnish if you're on Redhat/RHEL, or /etc/default/varnish if you're on Debian/Ubuntu

qweet
  • 562
  • 6
  • 11
15

There are two places that you will need to do varnish configuration:

  1. /etc/default/varnish
  2. /etc/varnish/default.vcl
oers
  • 18,436
  • 13
  • 66
  • 75
chen
  • 151
  • 1
  • 2
  • Second path may be different, but if, it's defined in first file, so start searching there. – gnysek Jun 24 '15 at 09:28
9

This is on centos linux server

/etc/sysconfig/varnish
/etc/varnish/default.vcl

you will also have to change httpd config file to change the port if you want to put varnish in front of apache

/etc/httpd/conf/httpd.conf

Source: How to install and configure Varnish with Apache on Centos 6

Chris Perez
  • 91
  • 1
  • 1
6

It's also worth noting that reloading the varnish config after editing clears it's cache.

omatica
  • 194
  • 2
  • 8