Commit 549a56b2 authored by Kristian Lyngstøl's avatar Kristian Lyngstøl

generate section 1 man pages from rst

fix some rst2man rendering issues

git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5010 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent b39db7f6
......@@ -4,7 +4,9 @@ INCLUDES = -I$(top_srcdir)/include
bin_PROGRAMS = varnishadm
if HAVE_RST2MAN
dist_man_MANS = varnishadm.1
endif
varnishadm_SOURCES = \
varnishadm.c
......@@ -14,3 +16,13 @@ varnishadm_LDADD = \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
${PTHREAD_LIBS} ${NET_LIBS}
%.1: ../../doc/sphinx/reference/%.rst
if HAVE_RST2MAN
${RST2MAN} $< >$@
else
@echo "========================================"
@echo "You need rst2man installed to make dist"
@echo "========================================"
@false
endif
.\"-
.\" Copyright (c) 2006 Verdens Gang AS
.\" Copyright (c) 2006-2009 Linpro AS
.\" All rights reserved.
.\"
.\" Author: Cecilie Fritzvold <cecilihf@linpro.no>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id$
.\"
.Dd January 31, 2008
.Dt VARNISHADM 1
.Os
.Sh NAME
.Nm varnishadm
.Nd Control a running varnish instance
.Sh SYNOPSIS
.Nm
.Op Fl t Ar timeout
.Op Fl S Ar secret_file
.Fl T Ar address Ns : Ns Ar port
.Op Cm command Op Ar ...
.Sh DESCRIPTION
The
.Nm
utility establishes a CLI connection using the
.Fl T
and
.Fl S
arguments.
.Pp
If a
.Cm command
is given, the command and arguments are sent over the
CLI connection and the result returned on stdout.
.Pp
If no
.Cm command
argument is given
.Nm
will pass commands and replies between the CLI socket and
stdin/stdout.
.Pp
The following options are available:
.Bl -tag -width Fl
.It Fl t Ar timeout
Wait no longer than this many seconds for an operation to finish.
.It Fl S Ar secret_file
Specify the authentication secret file.
.Pp
This should be the same -S argument as was given to
.Nm varnishd .
.Pp
Only processes which can read the contents of this file, will be able
to authenticate the CLI connection.
.It Fl T Ar address Ns : Ns Ar port
Connect to the management interface at the specified address and port.
.El
.Pp
Available commands and parameters are documented in the
.Xr varnishd 1
manual page.
Additionally, a summary of commands can be obtained by issuing the
.Cm help
command, and a summary of parameters can be obtained by issuing the
.Cm param.show
command.
.Sh EXIT STATUS
If a
.Cm command
is given,
the exit status of the
.Nm
utility is zero if the command succeeded, and non-zero otherwise.
.Sh EXAMPLES
Some ways you can use varnishadm:
.Pp
.Dl varnishadm -T localhost:999 -S /var/db/secret vcl.use foo
.Pp
.Dl echo vcl.use foo | varnishadm -T localhost:999 -S /var/db/secret
.Pp
.Dl echo vcl.use foo | ssh vhost varnishadm -T localhost:999 -S /var/db/secret
.Sh SEE ALSO
.Xr varnishd 1
.Sh HISTORY
The
.Nm
utility and this manual page were written by
.An Cecilie Fritzvold Aq cecilihf@linpro.no .
......@@ -4,7 +4,9 @@ INCLUDES = -I$(top_srcdir)/include
sbin_PROGRAMS = varnishd
if HAVE_RST2MAN
dist_man_MANS = varnishd.1
endif
varnishd_SOURCES = \
cache_acceptor.c \
......@@ -100,3 +102,13 @@ default_vcl.h: default.vcl Makefile
# Explicitly record dependency
mgt_vcc.c: default_vcl.h
%.1: ../../doc/sphinx/reference/%.rst
if HAVE_RST2MAN
${RST2MAN} $< >$@
else
@echo "========================================"
@echo "You need rst2man installed to make dist"
@echo "========================================"
@false
endif
.\"-
.\" Copyright (c) 2006 Verdens Gang AS
.\" Copyright (c) 2006-2010 Redpill Linpro AS
.\" All rights reserved.
.\"
.\" Author: Dag-Erling Smørgrav <des@des.no>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id$
.\"
.Dd February 17, 2008
.Dt VARNISHD 1
.Os
.Sh NAME
.Nm varnishd
.Nd HTTP accelerator daemon
.Sh SYNOPSIS
.Nm
.Oo Fl a Ar address Ns
.Op : Ns Ar port
.Oc
.Oo Fl b Ar host Ns
.Op : Ns Ar port
.Oc
.Op Fl d
.Op Fl F
.Op Fl f Ar config
.Op Fl g Ar group
.Oo Fl h Ar type Ns
.Op , Ns Ar options
.Oc
.Op Fl i Ar identity
.Op Fl l Ar shmlogsize
.Op Fl n Ar name
.Op Fl P Ar file
.Op Fl p Ar param Ns = Ns Ar value
.Oo Fl s Ar type Ns
.Op , Ns Ar options
.Oc
.Oo Fl T Ar address Ns
.Op : Ns Ar port
.Oc
.Op Fl t Ar ttl
.Op Fl u Ar user
.Op Fl V
.Oo Fl w Ar min Ns
.Oo , Ns Ar max Ns
.Op , Ns Ar timeout
.Oc Oc
.Sh DESCRIPTION
The
.Nm
daemon accepts HTTP requests from clients, passes them on to a backend
server and caches the returned documents to better satisfy future
requests for the same document.
.Pp
The following options are available:
.Bl -tag -width Fl
.It Fl a Ar address Ns Xo
.Op : Ns Ar port Ns
.Oo , Ns Ar address Ns
.Op : Ns Ar port Ns
.Oc
.Op ...
.Xc
Listen for client requests on the specified
.Ar address
and
.Ar port .
The
.Ar address
can be a host name
.Pq Dq localhost ,
an IPv4 dotted-quad
.Pq Dq 127.0.0.1 ,
or an IPv6 address enclosed in square brackets
.Pq Dq [::1] .
If
.Ar address
is not specified,
.Nm
will listen on all available IPv4 and IPv6 interfaces.
If
.Ar port
is not specified, the default HTTP port as listed in
.Pa /etc/services
is used.
Multiple listening addresses and ports can be specified as a
whitespace- or comma-separated list.
.It Fl b Ar host Ns Xo
.Op : Ns Ar port
.Xc
Use the specified
.Ar host
as backend server.
If
.Ar port
is not specified, the default is 8080.
.It Fl d
Enables debugging mode:
The parent process runs in the foreground with a CLI connection on
stdin/stdout, and the child process must
be started explicitly with a CLI command.
Terminating the parent process will also terminate the child.
.It Fl F
Run in the foreground.
.It Fl f Ar config
Use the specified VCL configuration file instead of the builtin
default.
See
.Xr vcl 7
for details on VCL syntax.
.It Fl g Ar group
Specifies the name of an unprivileged group to which the child process
should switch before it starts accepting connections.
This is a shortcut for specifying the
.Va group
run-time parameter.
.It Fl h Ar type Ns Xo
.Op , Ns Ar options
.Xc
Specifies the hash algorithm.
See
.Sx Hash Algorithms
for a list of supported algorithms.
.It Fl i Ar identity
Specify the identity of the varnish server. This can be accessed
using
.Va server.identity
from VCL
.It Fl l Ar shmlogsize
Specify size of shmlog file.
Scaling suffixes like 'k', 'm' can be used up to (e)tabytes.
Default is 80 Megabytes.
Specifying less than 8 Megabytes is unwise.
.It Fl n Ar name
Specify a name for this instance.
Amonst other things, this name is used to construct the name of the
directory in which
.Nm
keeps temporary files and persistent state.
If the specified name begins with a forward slash, it is interpreted
as the absolute path to the directory which should be used for this
purpose.
.It Fl P Ar file
Write the process's PID to the specified
.Ar file .
.It Fl p Ar param Ns = Ns Ar value
Set the parameter specified by
.Ar param
to the specified
.Ar value .
See
.Sx Run-Time Parameters
for a list of parameters.
.It Fl S Ar file
Path to a file containing a secret used for authorizing access to the
management port.
.It Fl s Ar type Ns Xo
.Op , Ns Ar options
.Xc
Use the specified storage backend.
See
.Sx Storage Types
for a list of supported storage types.
This option can be used multiple times to specify multiple storage
files.
.It Fl T Ar address Ns Xo
.Op : Ns Ar port
.Xc
Offer a management interface on the specified
.Ar address
and
.Ar port .
See
.Sx Management Interface
for a list of management commands.
.It Fl t Ar ttl
Specifies a hard minimum time to live for cached documents.
This is a shortcut for specifying the
.Va default_ttl
run-time parameter.
.It Fl u Ar user
Specifies the name of an unprivileged user to which the child process
should switch before it starts accepting connections.
This is a shortcut for specifying the
.Va user
run-time parameter.
.Pp
If specifying both a user and a group, the user should be specified
first.
.It Fl V
Display the version number and exit.
.It Fl w Ar min Ns Xo
.Oo , Ns Ar max Ns
.Op , Ns Ar timeout
.Oc
.Xc
Start at least
.Ar min
but no more than
.Ar max
worker threads with the specified idle timeout.
This is a shortcut for specifying the
.Va thread_pool_min ,
.Va thread_pool_max
and
.Va thread_pool_timeout
run-time parameters.
.Pp
If only one number is specified,
.Va thread_pool_min
and
.Va thread_pool_max
are both set to this number, and
.Va thread_pool_timeout
has no effect.
.El
.Ss Hash Algorithms
The following hash algorithms are available:
.Bl -tag -width 4n
.It Cm simple_list
A simple doubly-linked list.
Not recommended for production use.
.It Cm classic Ns Xo
.Op Ns , Ns Ar buckets
.Xc
A standard hash table.
This is the default.
.Pp
The hash key is the CRC32 of the object's URL modulo the size of the
hash table.
Each table entry points to a list of elements which share the same
hash key.
.Pp
The
.Ar buckets
parameter specifies the number of entries in the hash table.
The default is 16383.
.El
.Ss Storage Types
The following storage types are available:
.Bl -tag -width 4n
.It Cm malloc Ns Xo
.Op Ns , Ns Ar size Ns
.Xc
Storage for each object is allocated with
.Xr malloc 3 .
.Pp
The
.Ar size
parameter specifies the maximum amount of memory varnishd will allocate.
The size is assumed to be in bytes, unless followed by one of the
following suffixes:
.Bl -tag -width indent
.It K, k
The size is expressed in kibibytes.
.It M, m
The size is expressed in mebibytes.
.It G, g
The size is expressed in gibibytes.
.It T, t
The size is expressed in tebibytes.
.El
.Pp
The default size is unlimited.
.It Cm file Ns Xo
.Oo Ns , Ns Ar path Ns
.Oo Ns , Ns Ar size Ns
.Op Ns , Ns Ar granularity
.Oc Oc
.Xc
Storage for each object is allocated from an arena backed by a file.
This is the default.
.Pp
The
.Ar path
parameter specifies either the path to the backing file or the path to
a directory in which
.Nm
will create the backing file.
The default is
.Pa /tmp .
.Pp
The
.Ar size
parameter specifies the size of the backing file.
The size is assumed to be in bytes, unless followed by one of the
following suffixes:
.Bl -tag -width indent
.It K, k
The size is expressed in kibibytes.
.It M, m
The size is expressed in mebibytes.
.It G, g
The size is expressed in gibibytes.
.It T, t
The size is expressed in tebibytes.
.It %
The size is expressed as a percentage of the free space on the file
system where it resides.
.El
.Pp
The default size is 50%.
.Pp
If the backing file already exists, it will be truncated or expanded
to the specified size.
.Pp
Note that if
.Nm
has to create or expand the file, it will not pre-allocate the added
space, leading to fragmentation, which may adversely impact
performance.
Pre-creating the storage file using
.Xr dd 1
will reduce fragmentation to a minimum.
.Pp
The
.Ar granularity
parameter specifies the granularity of allocation.
All allocations are rounded up to this size.
The size is assumed to be in bytes, unless followed by one of the
suffixes described for
.Ar size
except for %.
.Pp
The default size is the VM page size.
The size should be reduced if you have many small objects.
.El
.Ss Management Interface
If the
.Fl T
option was specified,
.Nm
will offer a command-line management interface on the specified
address and port.
The following commands are available:
.Bl -tag -width 4n
.It Cm help Op Ar command
Display a list of available commands.
.Pp
If the
.Ar command
is specified, display help for this command.
.It Cm param.set Ar param Ar value
Set the parameter specified by
.Ar param
to the specified
.Ar value .
See
.Sx Run-Time Parameters
for a list of parameters.
.It Xo
.Cm param.show
.Op Fl l
.Op Ar param
.Xc
Display a list if run-time parameters and their values.
.Pp
If the
.Fl l
option is specified, the list includes a brief explanation of each
parameter.
.Pp
If a
.Ar param
is specified, display only the value and explanation for this
parameter.
.It Cm ping Op Ns Ar timestamp
Ping the Varnish cache process, keeping the connection alive.
.It Cm purge Ar field Ar operator Ar argument Xo
.Oo && Ar field Ar operator Ar argument Oo ...
.Oc Oc
.Xc
Immediately invalidate all documents matching the purge expression.
See
.Va Purge expressions
for more documentation and examples.
.It Cm purge.list
Display the purge list.
.Pp
All requests for objects from the cache are matched against items on
the purge list.
If an object in the cache is older than a matching purge list item, it
is considered
.Qq purged ,
and will be fetched from the backend instead.
.Pp
When a purge expression is older than all the objects in the cache, it
is removed from the list.
.It Cm purge.url Ar regexp
Immediately invalidate all documents whose URL matches the specified
regular expression.
.It Cm quit
Close the connection to the varnish admin port.
.It Cm start
Start the Varnish cache process if it is not already running.
.It Cm stats
Show summary statistics.
.Pp
All the numbers presented are totals since server startup; for a
better idea of the current situation, use the
.Xr varnishstat 1
utility.
.It Cm status
Check the status of the Varnish cache process.
.It Cm stop
Stop the Varnish cache process.
.It Cm url.purge Ar regexp
Deprecated, see
.Cm purge.url
instead.
.It Cm vcl.discard Ar configname
Discard the configuration specified by
.Ar configname .
This will have no effect if the specified configuration has a non-zero
reference count.
.It Cm vcl.inline Ar configname Ar vcl
Create a new configuration named
.Ar configname
with the VCL code specified by
.Ar vcl ,
which must be a quoted string.
.It Cm vcl.list
List available configurations and their respective reference counts.
The active configuration is indicated with an asterisk ("*").
.It Cm vcl.load Ar configname Ar filename
Create a new configuration named
.Ar configname
with the contents of the specified file.
.It Cm vcl.show Ar configname
Display the source code for the specified configuration.
.It Cm vcl.use Ar configname
Start using the configuration specified by
.Ar configname
for all new requests.
Existing requests will continue using whichever configuration was in
use when they arrived.
.El
.Ss Run-Time Parameters
.Pp
Runtime parameters are marked with shorthand flags to avoid repeating
the same text over and over in the table below.
The meaning of the flags are:
.Bl -tag -width 4n
.It Va experimental
We have no solid information about good/bad/optimal values for this
parameter.
Feedback with experience and observations are most welcome.
.It Va delayed
This parameter can be changed on the fly, but will not take effect
immediately.
.It Va restart
The worker process must be stopped and restarted, before this parameter
takes effect.
.It Va reload
The VCL programs must be reloaded for this parameter to take effect.
.El
.Pp
Here is a list of all parameters, current as of last time we remembered
to update the manual page.
This text is produced from the same text you will find in the CLI
if you use the
.Cm param.show
command, so should there be a new parameter which is not listed here,
you can find the description using the CLI commands.
.Pp
Be aware that on 32 bit systems, certain default values, such as
.Va sess_workspace
(=16k) and
.Va thread_pool_stack
(=64k) are reduced relative to the values listed here, in order to conserve VM space.
.Pp
.\" ----------------------------------------------------------------
.\" This table is generated by running a -DDIAGNOSTIC version of
.\" varnishd with the secret "-x dumpmdoc" argument
.\" XXX: Much smarter if we could use .so params.mdoc...
.\" ----------------------------------------------------------------
.Bl -tag -width 4n
.It Va acceptor_sleep_decay
Default:
.Dv 0.900
.br
Flags:
.Dv "experimental"
.br
.Pp
If we run out of resources, such as file descriptors or worker threads, the acceptor will sleep between accepts.
.br
This parameter (multiplicatively) reduce the sleep duration for each succesfull accept. (ie: 0.9 = reduce by 10%)
.Pp
.It Va acceptor_sleep_incr
Units:
.Dv s
.br
Default:
.Dv 0.001
.br
Flags:
.Dv "experimental"
.br
.Pp
If we run out of resources, such as file descriptors or worker threads, the acceptor will sleep between accepts.
.br
This parameter control how much longer we sleep, each time we fail to accept a new connection.
.Pp
.It Va acceptor_sleep_max
Units:
.Dv s
.br
Default:
.Dv 0.050
.br
Flags:
.Dv "experimental"
.br
.Pp
If we run out of resources, such as file descriptors or worker threads, the acceptor will sleep between accepts.
.br
This parameter limits how long it can sleep between attempts to accept new connections.
.Pp
.It Va auto_restart
Units:
.Dv bool
.br
Default:
.Dv on
.br
.Pp
Restart child process automatically if it dies.
.Pp
.It Va ban_lurker_sleep
Units:
.Dv s
.br
Default:
.Dv 0.0
.br
.Pp
How long time does the ban lurker thread sleeps between successfull attempts to push the last item up the purge list. It always sleeps a second when nothing can be done.
.br
A value of zero disables the ban lurker.
.Pp
.It Va between_bytes_timeout
Units:
.Dv s
.br
Default:
.Dv 60
.br
.Pp
Default timeout between bytes when receiving data from backend. We only wait for this many seconds between bytes before giving up. A value of 0 means it will never time out. VCL can override this default value for each backend request and backend request. This parameter does not apply to pipe.
.Pp
.It Va cache_vbe_conns
Units:
.Dv bool
.br
Default:
.Dv off
.br
Flags:
.Dv "experimental"
.br
.Pp
Cache vbe_conn's or rely on malloc, that's the question.
.Pp
.It Va cc_command
Default:
.Dv exec cc -fpic -shared -Wl,-x -o %o %s
.br
Flags:
.Dv "must_reload"
.br
.Pp
Command used for compiling the C source code to a dlopen(3) loadable object. Any occurrence of %s in the string will be replaced with the source file name, and %o will be replaced with the output file name.
.Pp
.It Va cli_buffer
Units:
.Dv bytes
.br
Default:
.Dv 8192
.br
.Pp
Size of buffer for CLI input.
.br
You may need to increase this if you have big VCL files and use the vcl.inline CLI command.
.br
NB: Must be specified with -p to have effect.
.Pp
.It Va cli_timeout
Units:
.Dv seconds
.br
Default:
.Dv 10
.br
.Pp
Timeout for the childs replies to CLI requests from the master.
.Pp
.It Va clock_skew
Units:
.Dv s
.br
Default:
.Dv 10
.br
.Pp
How much clockskew we are willing to accept between the backend and our own clock.
.Pp
.It Va connect_timeout
Units:
.Dv s
.br
Default:
.Dv 0.4
.br
.Pp
Default connection timeout for backend connections. We only try to connect to the backend for this many seconds before giving up. VCL can override this default value for each backend and backend request.
.Pp
.It Va default_grace
Default:
.Dv 10seconds
.br
Flags:
.Dv "delayed"
.br
.Pp
Default grace period. We will deliver an object this long after it has expired, provided another thread is attempting to get a new copy.
.Pp
.It Va default_ttl
Units:
.Dv seconds
.br
Default:
.Dv 120
.br
.Pp
The TTL assigned to objects if neither the backend nor the VCL code assigns one.
.br
Objects already cached will not be affected by changes made until they are fetched from the backend again.
.br
To force an immediate effect at the expense of a total flush of the cache use "purge.url ."
.Pp
.It Va diag_bitmap
Units:
.Dv bitmap
.br
Default:
.Dv 0
.br
.Pp
Bitmap controlling diagnostics code:
.br
0x00000001 - CNT_Session states.
.br
0x00000002 - workspace debugging.
.br
0x00000004 - kqueue debugging.
.br
0x00000008 - mutex logging.
.br
0x00000010 - mutex contests.
.br
0x00000020 - waiting list.
.br
0x00000040 - object workspace.
.br
0x00001000 - do not core-dump child process.
.br
0x00002000 - only short panic message.
.br
0x00004000 - panic to stderr.
.br
0x00008000 - panic to abort2().
.br
0x00010000 - synchronize shmlog.
.br
0x00020000 - synchronous start of persistence.
.br
0x80000000 - do edge-detection on digest.
.br
Use 0x notation and do the bitor in your head :-)
.Pp
.It Va err_ttl
Units:
.Dv seconds
.br
Default:
.Dv 0
.br
.Pp
The TTL assigned to the synthesized error pages
.Pp
.It Va esi_syntax
Units:
.Dv bitmap
.br
Default:
.Dv 0
.br
.Pp
Bitmap controlling ESI parsing code:
.br
0x00000001 - Don't check if it looks like XML
.br
0x00000002 - Ignore non-esi elements
.br
0x00000004 - Emit parsing debug records
.br
Use 0x notation and do the bitor in your head :-)
.Pp
.It Va fetch_chunksize
Units:
.Dv kilobytes
.br
Default:
.Dv 128
.br
Flags:
.Dv "experimental"
.br
.Pp
The default chunksize used by fetcher. This should be bigger than the majority of objects with short TTLs.
.br
Internal limits in the storage_file module makes increases above 128kb a dubious idea.
.Pp
.It Va first_byte_timeout
Units:
.Dv s
.br
Default:
.Dv 60
.br
.Pp
Default timeout for receiving first byte from backend. We only wait for this many seconds for the first byte before giving up. A value of 0 means it will never time out. VCL can override this default value for each backend and backend request. This parameter does not apply to pipe.
.Pp
.It Va group
Default:
.Dv 
.br
Flags:
.Dv "must_restart"
.br
.Pp
The unprivileged group to run as.
.Pp
.It Va http_headers
Units:
.Dv header lines
.br
Default:
.Dv 64
.br
.Pp
Maximum number of HTTP headers we will deal with.
.br
This space is preallocated in sessions and workthreads only objects allocate only space for the headers they store.
.Pp
.It Va listen_address
Default:
.Dv :80
.br
Flags:
.Dv "must_restart"
.br
.Pp
Whitespace separated list of network endpoints where Varnish will accept requests.
.br
Possible formats: host, host:port, :port
.Pp
.It Va listen_depth
Units:
.Dv connections
.br
Default:
.Dv 1024
.br
Flags:
.Dv "must_restart"
.br
.Pp
Listen queue depth.
.Pp
.It Va log_hashstring
Units:
.Dv bool
.br
Default:
.Dv off
.br
.Pp
Log the hash string to shared memory log.
.Pp
.It Va log_local_address
Units:
.Dv bool
.br
Default:
.Dv off
.br
.Pp
Log the local address on the TCP connection in the SessionOpen shared memory record.
.Pp
.It Va lru_interval
Units:
.Dv seconds
.br
Default:
.Dv 2
.br
Flags:
.Dv "experimental"
.br
.Pp
Grace period before object moves on LRU list.
.br
Objects are only moved to the front of the LRU list if they have not been moved there already inside this timeout period. This reduces the amount of lock operations necessary for LRU list access.
.Pp
.It Va max_esi_includes
Units:
.Dv includes
.br
Default:
.Dv 5
.br
.Pp
Maximum depth of esi:include processing.
.Pp
.It Va max_restarts
Units:
.Dv restarts
.br
Default:
.Dv 4
.br
.Pp
Upper limit on how many times a request can restart.
.br
Be aware that restarts are likely to cause a hit against the backend, so don't increase thoughtlessly.
.Pp
.It Va overflow_max
Units:
.Dv %
.br
Default:
.Dv 100
.br
Flags:
.Dv "experimental"
.br
.Pp
Percentage permitted overflow queue length.
.Pp
This sets the ratio of queued requests to worker threads, above which sessions will be dropped instead of queued.
.Pp
.It Va ping_interval
Units:
.Dv seconds
.br
Default:
.Dv 3
.br
Flags:
.Dv "must_restart"
.br
.Pp
Interval between pings from parent to child.
.br
Zero will disable pinging entirely, which makes it possible to attach a debugger to the child.
.Pp
.It Va pipe_timeout
Units:
.Dv seconds
.br
Default:
.Dv 60
.br
.Pp
Idle timeout for PIPE sessions. If nothing have been received in either direction for this many seconds, the session is closed.
.Pp
.It Va prefer_ipv6
Units:
.Dv bool
.br
Default:
.Dv off
.br
.Pp
Prefer IPv6 address when connecting to backends which have both IPv4 and IPv6 addresses.
.Pp
.It Va purge_dups
Units:
.Dv bool
.br
Default:
.Dv on
.br
.Pp
Detect and eliminate duplicate purges.
.Pp
.It Va rush_exponent
Units:
.Dv requests per request
.br
Default:
.Dv 3
.br
Flags:
.Dv "experimental"
.br
.Pp
How many parked request we start for each completed request on the object.
.br
NB: Even with the implict delay of delivery, this parameter controls an exponential increase in number of worker threads.
.Pp
.It Va saintmode_threshold
Units:
.Dv objects
.br
Default:
.Dv 10
.br
Flags:
.Dv "experimental"
.br
.Pp
The maximum number of objects held off by saint mode before no further will be made to the backend until one times out. A value of 0 disables saintmode.
.Pp
.It Va send_timeout
Units:
.Dv seconds
.br
Default:
.Dv 600
.br
Flags:
.Dv "delayed"
.br
.Pp
Send timeout for client connections. If no data has been sent to the client in this many seconds, the session is closed.
.br
See setsockopt(2) under SO_SNDTIMEO for more information.
.Pp
.It Va sendfile_threshold
Units:
.Dv bytes
.br
Default:
.Dv -1
.br
Flags:
.Dv "experimental"
.br
.Pp
The minimum size of objects transmitted with sendfile.
.Pp
.It Va sess_timeout
Units:
.Dv seconds
.br
Default:
.Dv 5
.br
.Pp
Idle timeout for persistent sessions. If a HTTP request has not been received in this many seconds, the session is closed.
.Pp
.It Va sess_workspace
Units:
.Dv bytes
.br
Default:
.Dv 65536
.br
Flags:
.Dv "delayed"
.br
.Pp
Bytes of HTTP protocol workspace allocated for sessions. This space must be big enough for the entire HTTP protocol header and any edits done to it in the VCL code.
.br
Minimum is 1024 bytes.
.Pp
.It Va session_linger
Units:
.Dv ms
.br
Default:
.Dv 50
.br
Flags:
.Dv "experimental"
.br
.Pp
How long time the workerthread lingers on the session to see if a new request appears right away.
.br
If sessions are reused, as much as half of all reuses happen within the first 100 msec of the previous request completing.
.br
Setting this too high results in worker threads not doing anything for their keep, setting it too low just means that more sessions take a detour around the waiter.
.Pp
.It Va session_max
Units:
.Dv sessions
.br
Default:
.Dv 100000
.br
.Pp
Maximum number of sessions we will allocate before just dropping connections.
.br
This is mostly an anti-DoS measure, and setting it plenty high should not hurt, as long as you have the memory for it.
.Pp
.It Va shm_reclen
Units:
.Dv bytes
.br
Default:
.Dv 255
.br
.Pp
Maximum number of bytes in SHM log record.
.br
Maximum is 65535 bytes.
.Pp
.It Va shm_workspace
Units:
.Dv bytes
.br
Default:
.Dv 8192
.br
Flags:
.Dv "delayed"
.br
.Pp
Bytes of shmlog workspace allocated for worker threads. If too big, it wastes some ram, if too small it causes needless flushes of the SHM workspace.
.br
These flushes show up in stats as "SHM flushes due to overflow".
.br
Minimum is 4096 bytes.
.Pp
.It Va syslog_cli_traffic
Units:
.Dv bool
.br
Default:
.Dv on
.br
.Pp
Log all CLI traffic to syslog(LOG_INFO).
.Pp
.It Va thread_pool_add_delay
Units:
.Dv milliseconds
.br
Default:
.Dv 20
.br
Flags:
.Dv "experimental"
.br
.Pp
Wait at least this long between creating threads.
.Pp
Setting this too long results in insuffient worker threads.
.Pp
Setting this too short increases the risk of worker thread pile-up.
.Pp
.It Va thread_pool_add_threshold
Units:
.Dv requests
.br
Default:
.Dv 2
.br
Flags:
.Dv "experimental"
.br
.Pp
Overflow threshold for worker thread creation.
.Pp
Setting this too low, will result in excess worker threads, which is generally a bad idea.
.Pp
Setting it too high results in insuffient worker threads.
.Pp
.It Va thread_pool_fail_delay
Units:
.Dv milliseconds
.br
Default:
.Dv 200
.br
Flags:
.Dv "experimental"
.br
.Pp
Wait at least this long after a failed thread creation before trying to create another thread.
.Pp
Failure to create a worker thread is often a sign that the end is near, because the process is running out of RAM resources for thread stacks.
.br
This delay tries to not rush it on needlessly.
.Pp
If thread creation failures are a problem, check that thread_pool_max is not too high.
.Pp
It may also help to increase thread_pool_timeout and thread_pool_min, to reduce the rate at which treads are destroyed and later recreated.
.Pp
.It Va thread_pool_max
Units:
.Dv threads
.br
Default:
.Dv 500
.br
Flags:
.Dv "delayed, experimental"
.br
.Pp
The maximum number of worker threads in all pools combined.
.Pp
Do not set this higher than you have to, since excess worker threads soak up RAM and CPU and generally just get in the way of getting work done.
.Pp
.It Va thread_pool_min
Units:
.Dv threads
.br
Default:
.Dv 5
.br
Flags:
.Dv "delayed, experimental"
.br
.Pp
The minimum number of threads in each worker pool.
.Pp
Increasing this may help ramp up faster from low load situations where threads have expired.
.Pp
Minimum is 2 threads.
.Pp
.It Va thread_pool_purge_delay
Units:
.Dv milliseconds
.br
Default:
.Dv 1000
.br
Flags:
.Dv "delayed, experimental"
.br
.Pp
Wait this long between purging threads.
.Pp
This controls the decay of thread pools when idle(-ish).
.Pp
Minimum is 100 milliseconds.
.Pp
.It Va thread_pool_stack
Units:
.Dv bytes
.br
Default:
.Dv -1
.br
Flags:
.Dv "experimental"
.br
.Pp
Worker thread stack size. In particular on 32bit systems you may need to tweak this down to fit many threads into the limited address space.
.Pp
.It Va thread_pool_timeout
Units:
.Dv seconds
.br
Default:
.Dv 300
.br
Flags:
.Dv "delayed, experimental"
.br
.Pp
Thread idle threshold.
.Pp
Threads in excess of thread_pool_min, which have been idle for at least this long are candidates for purging.
.Pp
Minimum is 1 second.
.Pp
.It Va thread_pools
Units:
.Dv pools
.br
Default:
.Dv 2
.br
Flags:
.Dv "delayed, experimental"
.br
.Pp
Number of worker thread pools.
.Pp
Increasing number of worker pools decreases lock contention.
.Pp
Too many pools waste CPU and RAM resources, and more than one pool for each CPU is probably detrimal to performance.
.Pp
Can be increased on the fly, but decreases require a restart to take effect.
.Pp
.It Va thread_stats_rate
Units:
.Dv requests
.br
Default:
.Dv 10
.br
Flags:
.Dv "experimental"
.br
.Pp
Worker threads accumulate statistics, and dump these into the global stats counters if the lock is free when they finish a request.
.br
This parameters defines the maximum number of requests a worker thread may handle, before it is forced to dump its accumulated stats into the global counters.
.Pp
.It Va user
Default:
.Dv 
.br
Flags:
.Dv "must_restart"
.br
.Pp
The unprivileged user to run as. Setting this will also set "group" to the specified user's primary group.
.Pp
.It Va vcl_trace
Units:
.Dv bool
.br
Default:
.Dv off
.br
.Pp
Trace VCL execution in the shmlog.
.br
Enabling this will allow you to see the path each request has taken through the VCL program.
.br
This generates a lot of logrecords so it is off by default.
.Pp
.It Va waiter
Default:
.Dv default
.br
Flags:
.Dv "must_restart, experimental"
.br
.Pp
Select the waiter kernel interface.
.Pp
.El
.\" ----------------------------------------------------------------
.\" End of machine generated table
.\" ----------------------------------------------------------------
.Ss Purge expressions
A purge expression consists of one or more conditions.
A condition consists of a field, an operator, and an argument.
Conditions can be ANDed together with
.Qq && .
.Pp
A field can be any of the variables from VCL, for instance
.Va req.url ,
.Va req.http.host
or
.Va obj.set-cookie .
.Pp
Operators are
.Qq ==
for direct comparision,
.Qq ~
for a regular expression match, and
.Qq >
or
.Qq <
for size comparisons.
Prepending an operator with
.Qq \&!
negates the expression.
.Pp
The argument could be a quoted string, a regexp, or an integer.
Integers can have
.Qq KB ,
.Qq MB ,
.Qq GB
or
.Qq TB
appended for size related fields.
.Pp
Simple example: All requests where
.Va req.url
exactly matches the string
.Va /news
are purged from the cache.
.Bd -literal -offset 4n
req.url == "/news"
.Ed
.Pp
Example: Purge all documents where the name does not end with
.Qq .ogg ,
and where the size of the object is greater than 10 megabytes.
.Bd -literal -offset 4n
req.url !~ "\\.ogg$" && obj.size > 10MB
.Ed
.Pp
Example: Purge all documents where the serving host is
.Qq example.com
or
.Qq www.example.com ,
and where the Set-Cookie header received from the backend contains
.Qq USERID=1663 .
.Bd -literal -offset 4n
req.http.host ~ "^(www\\.)example.com$" && obj.set-cookie ~ "USERID=1663"
.Ed
.Sh SEE ALSO
.Xr varnishlog 1 ,
.Xr varnishhist 1 ,
.Xr varnishncsa 1 ,
.Xr varnishstat 1 ,
.Xr varnishtop 1 ,
.Xr vcl 7
.\" .Sh STANDARDS
.\" .Rs
.\" .%A R. Fielding
.\" .%A J. Gettys
.\" .%A J. Mogul
.\" .%A H. Frystyk
.\" .%A L. Masinter
.\" .%A P. Leach
.\" .%A T. Berners-Lee
.\" .%D January 1999
.\" .%B Hypertext Transfer Protocol -- HTTP/1.1
.\" .%O RFC2616
.Sh HISTORY
The
.Nm
daemon was developed by
.An Poul-Henning Kamp Aq phk@phk.freebsd.dk
in cooperation with Verdens Gang AS and Linpro AS.
This manual page was written by
.An Dag-Erling Sm\(/orgrav Aq des@des.no
with updates by
.An Stig Sandbeck Mathisen Aq ssm@debian.org
......@@ -4,7 +4,9 @@ INCLUDES = -I$(top_srcdir)/include
bin_PROGRAMS = varnishhist
if HAVE_RST2MAN
dist_man_MANS = varnishhist.1
endif
varnishhist_SOURCES = varnishhist.c
......@@ -13,3 +15,13 @@ varnishhist_LDADD = \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
-lm \
${CURSES_LIBS} ${PTHREAD_LIBS}
%.1: ../../doc/sphinx/reference/%.rst
if HAVE_RST2MAN
${RST2MAN} $< >$@
else
@echo "========================================"
@echo "You need rst2man installed to make dist"
@echo "========================================"
@false
endif
.\"-
.\" Copyright (c) 2006 Verdens Gang AS
.\" Copyright (c) 2006-2009 Linpro AS
.\" All rights reserved.
.\"
.\" Author: Dag-Erling Smørgrav <des@des.no>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id$
.\"
.Dd June 28, 2007
.Dt VARNISHHIST 1
.Os
.Sh NAME
.Nm varnishhist
.Nd Varnish request histogram
.Sh SYNOPSIS
.Nm
.Op Fl b
.Op Fl C
.Op Fl c
.Op Fl d
.Op Fl I Ar regex
.Op Fl i Ar tag
.Op Fl n Ar varnish_name
.Op Fl r Ar file
.Op Fl V
.Op Fl w Ar delay
.Op Fl X Ar regex
.Op Fl x Ar tag
.Sh DESCRIPTION
The
.Nm
utility reads
.Xr varnishd 1
shared memory logs and presents a continuously updated histogram
showing the distribution of the last
.Va N
requests by their processing.
The value of
.Va N
and the vertical scale are displayed in the top left corner.
The horizontal scale is logarithmic.
Hits are marked with a pipe character ("|"), and misses are marked
with a hash character ("#").
.Pp
The following options are available:
.Bl -tag -width Fl
.It Fl b
Include log entries which result from communication with a backend
server.
If neither
.Fl b
nor
.Fl c
is specified,
.Nm
acts as if they both were.
.It Fl C
Ignore case when matching regular expressions.
.It Fl c
Include log entries which result from communication with a client.
If neither
.Fl b
nor
.Fl c
is specified,
.Nm
acts as if they both were.
.It Fl d
Process old log entries on startup.
Normally,
.Nm
will only process entries which are written to the log after it
starts.
.It Fl I Ar regex
Include log entries which match the specified regular expression.
If neither
.Fl I
nor
.Fl i
is specified, all log entries are included.
.It Fl i Ar tag
Include log entries with the specified tag.
If neither
.Fl I
nor
.Fl i
is specified, all log entries are included.
.It Fl n
Specifies the name of the
.Nm varnishd
instance to get logs from.
If
.Fl n
is not specified, the host name is used.
.It Fl r Ar file
Read log entries from
.Ar file
instead of shared memory.
.It Fl V
Display the version number and exit.
.It Fl w Ar delay
Wait at least
.Ar delay
seconds between each update.
The default is 1.
.Ar file
instead of displaying them.
The file will be overwritten unless the
.Fl a
option was specified.
.It Fl X Ar regex
Exclude log entries which match the specified regular expression.
.It Fl x Ar tag
Exclude log entries with the specified tag.
.El
.Sh SEE ALSO
.Xr varnishd 1 ,
.Xr varnishlog 1 ,
.Xr varnishncsa 1 ,
.Xr varnishstat 1 ,
.Xr varnishtop 1
.Sh HISTORY
The
.Nm
utility was developed by
.An Poul-Henning Kamp Aq phk@phk.freebsd.dk
in cooperation with Verdens Gang AS and Linpro AS.
This manual page was written by
.An Dag-Erling Sm\(/orgrav Aq des@des.no .
......@@ -4,7 +4,9 @@ INCLUDES = -I$(top_srcdir)/include
bin_PROGRAMS = varnishlog
if HAVE_RST2MAN
dist_man_MANS = varnishlog.1
endif
varnishlog_SOURCES = varnishlog.c
......@@ -13,3 +15,13 @@ varnishlog_LDADD = \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
${PTHREAD_LIBS}
%.1: ../../doc/sphinx/reference/%.rst
if HAVE_RST2MAN
${RST2MAN} $< >$@
else
@echo "========================================"
@echo "You need rst2man installed to make dist"
@echo "========================================"
@false
endif
.\"-
.\" Copyright (c) 2006 Verdens Gang AS
.\" Copyright (c) 2006-2009 Linpro AS
.\" All rights reserved.
.\"
.\" Author: Dag-Erling Smørgrav <des@des.no>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id$
.\"
.Dd March 9, 2008
.Dt VARNISHLOG 1
.Os
.Sh NAME
.Nm varnishlog
.Nd Display Varnish logs
.Sh SYNOPSIS
.Nm
.Op Fl a
.Op Fl b
.Op Fl C
.Op Fl c
.Op Fl D
.Op Fl d
.Op Fl I Ar regex
.Op Fl i Ar tag
.Op Fl k Ar keep
.Op Fl n Ar varnish_name
.Op Fl o
.Op Fl P Ar file
.Op Fl r Ar file
.Op Fl s Ar num
.Op Fl u
.Op Fl V
.Op Fl w Ar file
.Op Fl X Ar regex
.Op Fl x Ar tag
.Op Ar tag Ar regex
.Sh DESCRIPTION
The
.Nm
utility reads and presents
.Xr varnishd 1
shared memory logs.
.Pp
The following options are available:
.Bl -tag -width Fl
.It Fl a
When writing to a file, append to it rather than overwrite it.
.It Fl b
Include log entries which result from communication with a backend
server.
If neither
.Fl b
nor
.Fl c
is specified,
.Nm
acts as if they both were.
.It Fl C
Ignore case when matching regular expressions.
.It Fl c
Include log entries which result from communication with a client.
If neither
.Fl b
nor
.Fl c
is specified,
.Nm
acts as if they both were.
.It Fl D
Daemonize.
.It Fl d
Process old log entries on startup.
Normally,
.Nm
will only process entries which are written to the log after it
starts.
.It Fl I Ar regex
Include log entries which match the specified regular expression.
If neither
.Fl I
nor
.Fl i
is specified, all log entries are included.
.It Fl i Ar tag
Include log entries with the specified tag.
If neither
.Fl I
nor
.Fl i
is specified, all log entries are included.
.It Fl k Ar num
Only show the first
.Nm num
log records.
.It Fl n
Specifies the name of the
.Nm varnishd
instance to get logs from.
If
.Fl n
is not specified, the host name is used.
.It Fl o
Group log entries by request ID.
This has no effect when writing to a file using the
.Fl w
option.
.It Fl P Ar file
Write the process's PID to the specified
.Ar file .
.It Fl r Ar file
Read log entries from
.Ar file
instead of shared memory.
.It Fl s Ar num
Skip the first
.Ar num
log records.
.It Fl u
Unbuffered output.
.It Fl V
Display the version number and exit.
.It Fl w Ar file
Write log entries to
.Ar file
instead of displaying them.
The file will be overwritten unless the
.Fl a
option was specified.
.Pp
If
.Nm
receives a
.Dv SIGHUP
while writing to a file, it will reopen the file, allowing the old one
to be rotated away.
.It Fl X Ar regex
Exclude log entries which match the specified regular expression.
.It Fl x Ar tag
Exclude log entries with the specified tag.
.El
.Pp
If the
.Fl o
option was specified, an additional
.Ar tag
and
.Ar regex
may be specified to select only requests which generated a log entry
with the given
.Ar tag
whose contents match the given
.Ar regex .
.Sh TAGS
The following log entry tags are currently defined:
.\" keep in sync with include/shmlog_tags.h
.\" XXX add descriptions
.Bl -tag -width 16
.It Dv Backend
.It Dv BackendClose
.It Dv BackendOpen
.It Dv BackendReuse
.It Dv BackendXID
.It Dv CLI
.It Dv ClientAddr
.It Dv Debug
.It Dv Error
.It Dv ExpBan
.It Dv ExpKill
.It Dv ExpPick
.It Dv Hit
.It Dv HitPass
.It Dv HttpError
.It Dv HttpGarbage
.It Dv Length
.It Dv ObjHeader
.It Dv ObjLostHeader
.It Dv ObjProtocol
.It Dv ObjRequest
.It Dv ObjResponse
.It Dv ObjStatus
.It Dv ObjURL
.It Dv ReqEnd
.It Dv ReqStart
.It Dv RxHeader
.It Dv RxLostHeader
.It Dv RxProtocol
.It Dv RxRequest
.It Dv RxResponse
.It Dv RxStatus
.It Dv RxURL
.It Dv SessionClose
.It Dv SessionOpen
.It Dv StatAddr
.It Dv StatSess
.It Dv TTL
.It Dv TxHeader
.It Dv TxLostHeader
.It Dv TxProtocol
.It Dv TxRequest
.It Dv TxResponse
.It Dv TxStatus
.It Dv TxURL
.It Dv VCL_acl
.It Dv VCL_call
.It Dv VCL_return
.It Dv VCL_trace
.It Dv WorkThread
.El
.Sh EXAMPLES
The following command line simply copies all log entries to a log
file:
.Bd -literal -offset 4n
$ varnishlog \-w /var/log/varnish.log
.Ed
.Pp
The following command line reads that same log file and displays
requests for the front page:
.Bd -literal -offset 4n
$ varnishlog \-r /var/log/varnish.log \-c \-o RxURL '^/$'
.Ed
.Sh SEE ALSO
.Xr varnishd 1 ,
.Xr varnishhist 1 ,
.Xr varnishncsa 1 ,
.Xr varnishstat 1 ,
.Xr varnishtop 1
.Sh HISTORY
The
.Nm
utility was developed by
.An Poul-Henning Kamp Aq phk@phk.freebsd.dk
in cooperation with Verdens Gang AS and Linpro AS.
This manual page was written by
.An Dag-Erling Sm\(/orgrav Aq des@des.no .
......@@ -4,7 +4,9 @@ INCLUDES = -I$(top_srcdir)/include
bin_PROGRAMS = varnishncsa
if HAVE_RST2MAN
dist_man_MANS = varnishncsa.1
endif
varnishncsa_SOURCES = varnishncsa.c
......@@ -13,3 +15,13 @@ varnishncsa_LDADD = \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
${PTHREAD_LIBS}
%.1: ../../doc/sphinx/reference/%.rst
if HAVE_RST2MAN
${RST2MAN} $< >$@
else
@echo "========================================"
@echo "You need rst2man installed to make dist"
@echo "========================================"
@false
endif
.\"-
.\" Copyright (c) 2006 Verdens Gang AS
.\" Copyright (c) 2006-2009 Linpro AS
.\" All rights reserved.
.\"
.\" Author: Dag-Erling Smørgrav <des@des.no>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id$
.\"
.Dd November 8, 2007
.Dt VARNISHNCSA 1
.Os
.Sh NAME
.Nm varnishncsa
.Nd Display Varnish logs in Apache / NCSA combined log format
.Sh SYNOPSIS
.Nm
.Op Fl a
.Op Fl b
.Op Fl C
.Op Fl c
.Op Fl D
.Op Fl d
.Op Fl f
.Op Fl I Ar regex
.Op Fl i Ar tag
.Op Fl n Ar varnish_name
.Op Fl P Ar file
.Op Fl r Ar file
.Op Fl V
.Op Fl w Ar file
.Op Fl X Ar regex
.Op Fl x Ar tag
.Sh DESCRIPTION
The
.Nm
utility reads
.Xr varnishd 1
shared memory logs and presents them in the Apache / NCSA
"combined" log format.
.Pp
The following options are available:
.Bl -tag -width Fl
.It Fl a
When writing to a file, append to it rather than overwrite it.
.It Fl b
Include log entries which result from communication with a backend
server.
If neither
.Fl b
nor
.Fl c
is specified,
.Nm
acts as if they both were.
.It Fl C
Ignore case when matching regular expressions.
.It Fl c
Include log entries which result from communication with a client.
If neither
.Fl b
nor
.Fl c
is specified,
.Nm
acts as if they both were.
.It Fl D
Daemonize.
.It Fl d
Process old log entries on startup.
Normally,
.Nm
will only process entries which are written to the log after it
starts.
.It Fl f
Prefer the
.Va X-Forwarded-For
HTTP header over
.Va client.ip
in the log output.
.It Fl I Ar regex
Include log entries which match the specified regular expression.
If neither
.Fl I
nor
.Fl i
is specified, all log entries are included.
.It Fl i Ar tag
Include log entries with the specified tag.
If neither
.Fl I
nor
.Fl i
is specified, all log entries are included.
.It Fl n
Specifies the name of the
.Nm varnishd
instance to get logs from.
If
.Fl n
is not specified, the host name is used.
.It Fl P Ar file
Write the process's PID to the specified
.Ar file .
.It Fl r Ar file
Read log entries from
.Ar file
instead of shared memory.
.It Fl V
Display the version number and exit.
.It Fl w Ar file
Write log entries to
.Ar file
instead of displaying them.
The file will be overwritten unless the
.Fl a
option was specified.
.Pp
If
.Nm
receives a
.Dv SIGHUP
while writing to a file, it will reopen the file, allowing the old one
to be rotated away.
.It Fl X Ar regex
Exclude log entries which match the specified regular expression.
.It Fl x Ar tag
Exclude log entries with the specified tag.
.El
.Sh SEE ALSO
.Xr varnishd 1 ,
.Xr varnishhist 1 ,
.Xr varnishlog 1 ,
.Xr varnishstat 1 ,
.Xr varnishtop 1 ,
.Sh HISTORY
The
.Nm
utility was developed by
.An Poul-Henning Kamp Aq phk@phk.freebsd.dk
in cooperation with Verdens Gang AS and Linpro AS.
This manual page was written by
.An Dag-Erling Sm\(/orgrav Aq des@des.no .
......@@ -4,7 +4,9 @@ INCLUDES = -I$(top_srcdir)/include
bin_PROGRAMS = varnishreplay
if HAVE_RST2MAN
dist_man_MANS = varnishreplay.1
endif
varnishreplay_SOURCES = \
varnishreplay.c
......@@ -14,3 +16,13 @@ varnishreplay_LDADD = \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
${PTHREAD_LIBS} ${NET_LIBS}
%.1: ../../doc/sphinx/reference/%.rst
if HAVE_RST2MAN
${RST2MAN} $< >$@
else
@echo "========================================"
@echo "You need rst2man installed to make dist"
@echo "========================================"
@false
endif
.\"-
.\" Copyright (c) 2007-2009 Linpro AS
.\" All rights reserved.
.\"
.\" Author: Cecilie Fritzvold <cecilihf@linpro.no>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id$
.\"
.Dd September 12, 2007
.Dt VARNISHREPLAY 1
.Os
.Sh NAME
.Nm varnishreplay
.Nd HTTP traffic replay tool
.Sh SYNOPSIS
.Nm
.Op Fl D
.Fl a Ar address Ns : Ns Ar port
.Fl r Ar file
.Sh DESCRIPTION
The
.Nm
utility parses varnish logs and attempts to reproduce the traffic.
.Pp
The following options are available:
.Bl -tag -width Fl
.It Fl a Ar address Ns : Ns Ar port
Send the traffic over tcp to this address and port.
This option is mandatory.
.It Fl D
Turn on debugging mode.
.It Fl r Ar file
Parse logs from this file.
This option is mandatory.
.El
.Sh SEE ALSO
.Xr varnishd 1 ,
.Xr varnishlog 1
.Sh HISTORY
The
.Nm
utility and this manual page were written by
.An Cecilie Fritzvold Aq cecilihf@linpro.no .
......@@ -4,7 +4,9 @@ INCLUDES = -I$(top_srcdir)/include
bin_PROGRAMS = varnishsizes
if HAVE_RST2MAN
dist_man_MANS = varnishsizes.1
endif
varnishsizes_SOURCES = varnishsizes.c
......@@ -13,3 +15,13 @@ varnishsizes_LDADD = \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
-lm \
${CURSES_LIBS} ${PTHREAD_LIBS}
%.1: ../../doc/sphinx/reference/%.rst
if HAVE_RST2MAN
${RST2MAN} $< >$@
else
@echo "========================================"
@echo "You need rst2man installed to make dist"
@echo "========================================"
@false
endif
.\"-
.\" Copyright (c) 2006 Verdens Gang AS
.\" Copyright (c) 2006-2009 Linpro AS
.\" All rights reserved.
.\"
.\" Author: Dag-Erling Smørgrav <des@des.no>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id$
.\"
.Dd June 28, 2007
.Dt VARNISHSIZES 1
.Os
.Sh NAME
.Nm varnishsizes
.Nd Varnish request histogram
.Sh SYNOPSIS
.Nm
.Op Fl b
.Op Fl C
.Op Fl c
.Op Fl d
.Op Fl I Ar regex
.Op Fl i Ar tag
.Op Fl n Ar varnish_name
.Op Fl r Ar file
.Op Fl V
.Op Fl w Ar delay
.Op Fl X Ar regex
.Op Fl x Ar tag
.Sh DESCRIPTION
The
.Nm
utility reads
.Xr varnishd 1
shared memory logs and presents a continuously updated histogram
showing the distribution of the last
.Va N
requests by their processing.
The value of
.Va N
and the vertical scale are displayed in the top left corner.
The horizontal scale is logarithmic.
Hits are marked with a pipe character ("|"), and misses are marked
with a hash character ("#").
.Pp
The following options are available:
.Bl -tag -width Fl
.It Fl b
Include log entries which result from communication with a backend
server.
If neither
.Fl b
nor
.Fl c
is specified,
.Nm
acts as if they both were.
.It Fl C
Ignore case when matching regular expressions.
.It Fl c
Include log entries which result from communication with a client.
If neither
.Fl b
nor
.Fl c
is specified,
.Nm
acts as if they both were.
.It Fl d
Process old log entries on startup.
Normally,
.Nm
will only process entries which are written to the log after it
starts.
.It Fl I Ar regex
Include log entries which match the specified regular expression.
If neither
.Fl I
nor
.Fl i
is specified, all log entries are included.
.It Fl i Ar tag
Include log entries with the specified tag.
If neither
.Fl I
nor
.Fl i
is specified, all log entries are included.
.It Fl n
Specifies the name of the
.Nm varnishd
instance to get logs from.
If
.Fl n
is not specified, the host name is used.
.It Fl r Ar file
Read log entries from
.Ar file
instead of shared memory.
.It Fl V
Display the version number and exit.
.It Fl w Ar delay
Wait at least
.Ar delay
seconds between each update.
The default is 1.
.Ar file
instead of displaying them.
The file will be overwritten unless the
.Fl a
option was specified.
.It Fl X Ar regex
Exclude log entries which match the specified regular expression.
.It Fl x Ar tag
Exclude log entries with the specified tag.
.El
.Sh SEE ALSO
.Xr varnishd 1 ,
.Xr varnishlog 1 ,
.Xr varnishncsa 1 ,
.Xr varnishstat 1 ,
.Xr varnishtop 1
.Sh SIZESORY
The
.Nm
utility was developed by
.An Poul-Henning Kamp Aq phk@phk.freebsd.dk
in cooperation with Verdens Gang AS and Linpro AS.
This manual page was written by
.An Dag-Erling Sm\(/orgrav Aq des@des.no .
......@@ -4,7 +4,9 @@ INCLUDES = -I$(top_srcdir)/include
bin_PROGRAMS = varnishstat
if HAVE_RST2MAN
dist_man_MANS = varnishstat.1
endif
varnishstat_SOURCES = \
varnishstat.h \
......@@ -16,3 +18,13 @@ varnishstat_LDADD = \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
${CURSES_LIBS} ${RT_LIBS} ${PTHREAD_LIBS}
%.1: ../../doc/sphinx/reference/%.rst
if HAVE_RST2MAN
${RST2MAN} $< >$@
else
@echo "========================================"
@echo "You need rst2man installed to make dist"
@echo "========================================"
@false
endif
.\"-
.\" Copyright (c) 2006 Verdens Gang AS
.\" Copyright (c) 2006-2009 Linpro AS
.\" All rights reserved.
.\"
.\" Author: Dag-Erling Smørgrav <des@des.no>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id$
.\"
.Dd June 28, 2007
.Dt VARNISHSTAT 1
.Os
.Sh NAME
.Nm varnishstat
.Nd HTTP accelerator statistics
.Sh SYNOPSIS
.Nm
.Op Fl 1
.Op Fl f Ar field_list
.Op Fl l
.Op Fl n Ar varnish_name
.Op Fl V
.Op Fl w Ar delay
.Sh DESCRIPTION
The
.Nm
utility displays statistics from a running
.Xr varnishd 1
instance.
.Pp
The following options are available:
.Bl -tag -width Fl
.It Fl 1
Instead of presenting of a continuously updated display, print the
statistics once and exit.
.It Fl f
A comma separated list of the fields to display.
If it starts with '^' it is used as an exclusion list.
.It Fl l
Lists the available fields to use with the
.Fl f
option.
.It Fl n
Specifies the name of the
.Nm varnishd
instance to get logs from.
If
.Fl n
is not specified, the host name is used.
.It Fl V
Display the version number and exit.
.It Fl w Ar delay
Wait
.Ar delay
seconds between updates.
The default is 1.
.El
.Pp
The columns in the main display are, from left to right:
.Bl -enum
.It
Value
.It
Per-second average in the period since last update, or a period if the
value can not be averaged
.It
Per-second average over process lifetime, or a period if the value can
not be averaged
.It
Descriptive text
.El
.Pp
When using the
.Fl 1
option, the columns in the output are, from left to right:
.Bl -enum
.It
Symbolic entry name
.It
Value
.It
Per-second average over process lifetime, or a period if the value can
not be averaged
.It
Descriptive text
.El
.Sh SEE ALSO
.Xr varnishd 1 ,
.Xr varnishhist 1 ,
.Xr varnishlog 1 ,
.Xr varnishncsa 1 ,
.Xr varnishtop 1 ,
.Xr curses 3
.Sh HISTORY
The
.Nm
utility was originally developed by
.An Poul-Henning Kamp Aq phk@phk.freebsd.dk
in cooperation with Verdens Gang AS and Linpro AS, and later
substantially rewritten by
.An Dag-Erling Sm\(/orgrav Aq des@des.no .
This manual page was written by
.An Dag-Erling Sm\(/orgrav Aq des@des.no .
......@@ -9,7 +9,9 @@ INCLUDES = -I$(top_srcdir)/include
bin_PROGRAMS = varnishtest
if HAVE_RST2MAN
dist_man_MANS = varnishtest.1
endif
varnishtest_SOURCES = \
vtc.c \
......@@ -29,3 +31,13 @@ varnishtest_LDADD = \
EXTRA_DIST = $(top_srcdir)/bin/varnishtest/tests/*.vtc \
$(top_srcdir)/bin/varnishtest/tests/README
%.1: ../../doc/sphinx/reference/%.rst
if HAVE_RST2MAN
${RST2MAN} $< >$@
else
@echo "========================================"
@echo "You need rst2man installed to make dist"
@echo "========================================"
@false
endif
.\"-
.\" Copyright (c) 2008-2009 Linpro AS
.\" All rights reserved.
.\"
.\" Author: Stig Sandbeck Mathisen <ssm@linpro.no>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id$
.\"
.Dd February 13, 2009
.Dt VARNISHTEST 1
.Os
.Sh NAME
.Nm varnishtest
.Nd Test program for Varnish
.Sh SYNOPSIS
.Nm
.Op Fl n Ar iter
.Op Fl q
.Op Fl v
.Ar file
.Op Ar file ...
.Sh DESCRIPTION
The
.Nm
program is a script driven program used to test the varnish HTTP
accelerator.
.Pp
The
.Nm
program, when started and given one or more script files, can create a
number of threads representing backends, some threads representing
clients, and a varnishd process.
.Pp
The following options are available:
.Bl -tag -width Fl
.It Fl n Ar iter
Run
.Ar iter
number of iterations.
.It Fl q
Be quiet.
.It Fl v
Be verbose.
.It Ar file
File to use as a script
.El
.Sh SCRIPTS
.Ss Example script
.Bd -literal -offset 4n
# Start a varnish instance called "v1"
varnish v1 \-arg "\-b localhost:9080" \-start
# Create a server thread called "s1"
server s1 {
# Receive a request
rxreq
# Send a standard response
txresp \-hdr "Connection: close" \-body "012345\\n"
}
# Start the server thread
server s1 \-start
# Create a client thread called "c1"
client c1 {
# Send a request
txreq \-url "/"
# Wait for a response
rxresp
# Insist that it be a success
expect resp.status == 200
}
# Run the client
client c1 \-run
# Wait for the server to die
server s1 \-wait
# (Forcefully) Stop the varnish instance.
varnish v1 \-stop
.Ed
.Ss Example script output
The output, running this script looks as follows.
.Pp
The "bargraph" at the beginning of the line is an indication of the
level of detail in the line.
.Pp
The second field where the message comes from
.Pp
The rest of the line is anyones guess :-)
.Bd -literal -offset 4n
# TEST tests/b00000.vtc starting
### v1 CMD: cd ../varnishd && ./varnishd \-d \-d \-n v1 \-a :9081 \-T :9001 \-b localhost:9080
### v1 opening CLI connection
#### v1 debug| NB: Storage size limited to 2GB on 32 bit architecture,\\n
#### v1 debug| NB: otherwise we could run out of address space.\\n
#### v1 debug| storage_file: filename: ./varnish.Shkoq5 (unlinked) size 2047 MB.\\n
### v1 CLI connection fd = 3
#### v1 CLI TX| start
#### v1 debug| Using old SHMFILE\\n
#### v1 debug| Notice: locking SHMFILE in core failed: Operation not permitted\\n
#### v1 debug| bind(): Address already in use\\n
#### v1 debug| rolling(1)...
#### v1 debug| \\n
#### v1 debug| rolling(2)...\\n
#### v1 debug| Debugging mode, enter "start" to start child\\n
### v1 CLI 200 <start>
## s1 Starting server
### s1 listen on :9080 (fd 6)
## c1 Starting client
## c1 Waiting for client
## s1 started on :9080
## c1 started
### c1 connect to :9081
### c1 connected to :9081 fd is 8
#### c1 | GET / HTTP/1.1\\r\\n
#### c1 | \\r\\n
### c1 rxresp
#### s1 Accepted socket 7
### s1 rxreq
#### s1 | GET / HTTP/1.1\\r\\n
#### s1 | X-Varnish: 422080121\\r\\n
#### s1 | X-Forwarded-For: 127.0.0.1\\r\\n
#### s1 | Host: localhost\\r\\n
#### s1 | \\r\\n
#### s1 http[ 0] | GET
#### s1 http[ 1] | /
#### s1 http[ 2] | HTTP/1.1
#### s1 http[ 3] | X-Varnish: 422080121
#### s1 http[ 4] | X-Forwarded-For: 127.0.0.1
#### s1 http[ 5] | Host: localhost
#### s1 | HTTP/1.1 200 Ok\\r\\n
#### s1 | Connection: close\\r\\n
#### s1 | \\r\\n
#### s1 | 012345\\n
#### s1 | \\r\\n
## s1 ending
#### c1 | HTTP/1.1 200 Ok\\r\\n
#### c1 | Content-Length: 9\\r\\n
#### c1 | Date: Mon, 16 Jun 2008 22:16:55 GMT\\r\\n
#### c1 | X-Varnish: 422080121\\r\\n
#### c1 | Age: 0\\r\\n
#### c1 | Via: 1.1 varnish\\r\\n
#### c1 | Connection: keep-alive\\r\\n
#### c1 | \\r\\n
#### c1 http[ 0] | HTTP/1.1
#### c1 http[ 1] | 200
#### c1 http[ 2] | Ok
#### c1 http[ 3] | Content-Length: 9
#### c1 http[ 4] | Date: Mon, 16 Jun 2008 22:16:55 GMT
#### c1 http[ 5] | X-Varnish: 422080121
#### c1 http[ 6] | Age: 0
#### c1 http[ 7] | Via: 1.1 varnish
#### c1 http[ 8] | Connection: keep-alive
#### c1 EXPECT resp.status (200) == 200 (200) match
## c1 ending
## s1 Waiting for server
#### v1 CLI TX| stop
### v1 CLI 200 <stop>
# TEST tests/b00000.vtc completed
.Ed
.Pp
If instead of 200 we had expected 201 with the line:
.Bd -literal -offset 4n
expect resp.status == 201
.Ed
.Pp
The output would have ended with:
.Bd -literal -offset 4n
#### c1 http[ 0] | HTTP/1.1
#### c1 http[ 1] | 200
#### c1 http[ 2] | Ok
#### c1 http[ 3] | Content-Length: 9
#### c1 http[ 4] | Date: Mon, 16 Jun 2008 22:26:35 GMT
#### c1 http[ 5] | X-Varnish: 648043653 648043652
#### c1 http[ 6] | Age: 6
#### c1 http[ 7] | Via: 1.1 varnish
#### c1 http[ 8] | Connection: keep-alive
---- c1 EXPECT resp.status (200) == 201 (201) failed
.Ed
.Sh SEE ALSO
.Xr varnishhist 1 ,
.Xr varnishlog 1 ,
.Xr varnishncsa 1 ,
.Xr varnishstat 1 ,
.Xr varnishtop 1 ,
.Xr vcl 7
.Sh HISTORY
The
.Nm
program was developed by
.An Poul-Henning Kamp Aq phk@phk.freebsd.dk
in cooperation with Linpro AS.
This manual page was written by
.An Stig Sandbeck Mathisen Aq ssm@linpro.no
using examples by
.An Poul-Henning Kamp Aq phk@phk.freebsd.dk .
......@@ -4,7 +4,9 @@ INCLUDES = -I$(top_srcdir)/include
bin_PROGRAMS = varnishtop
if HAVE_RST2MAN
dist_man_MANS = varnishtop.1
endif
varnishtop_SOURCES = varnishtop.c
......@@ -12,3 +14,13 @@ varnishtop_LDADD = \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
${CURSES_LIBS} ${PTHREAD_LIBS}
%.1: ../../doc/sphinx/reference/%.rst
if HAVE_RST2MAN
${RST2MAN} $< >$@
else
@echo "========================================"
@echo "You need rst2man installed to make dist"
@echo "========================================"
@false
endif
.\"-
.\" Copyright (c) 2006 Verdens Gang AS
.\" Copyright (c) 2006-2009 Linpro AS
.\" All rights reserved.
.\"
.\" Author: Dag-Erling Smørgrav <des@des.no>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id$
.\"
.Dd June 28, 2007
.Dt VARNISHTOP 1
.Os
.Sh NAME
.Nm varnishtop
.Nd Varnish log entry ranking
.Sh SYNOPSIS
.Nm
.Op Fl 1
.Op Fl b
.Op Fl C
.Op Fl c
.Op Fl d
.Op Fl f
.Op Fl I Ar regex
.Op Fl i Ar tag
.Op Fl n Ar varnish_name
.Op Fl r Ar file
.Op Fl V
.Op Fl X Ar regex
.Op Fl x Ar tag
.Sh DESCRIPTION
The
.Nm
utility reads
.Xr varnishd 1
shared memory logs and presents a continuously updated list of the
most commonly occurring log entries.
With suitable filtering using the
.Fl I ,
.Fl i ,
.Fl X
and
.Fl x
options, it can be used to display a ranking of requested documents,
clients, user agents, or any other information which is recorded in
the log.
.Pp
The following options are available:
.Bl -tag -width Fl
.It Fl 1
Instead of presenting of a continuously updated display, print the
statistics once and exit.
Implies
.Fl d .
.It Fl b
Include log entries which result from communication with a backend
server.
If neither
.Fl b
nor
.Fl c
is specified,
.Nm
acts as if they both were.
.It Fl C
Ignore case when matching regular expressions.
.It Fl c
Include log entries which result from communication with a client.
If neither
.Fl b
nor
.Fl c
is specified,
.Nm
acts as if they both were.
.It Fl d
Process old log entries on startup.
Normally,
.Nm
will only process entries which are written to the log after it
starts.
.It Fl f
Sort and group only on the first field of each log entry.
This is useful when displaying e.g.
.Dv stataddr
entries, where the first field is the client IP address.
.It Fl I Ar regex
Include log entries which match the specified regular expression.
If neither
.Fl I
nor
.Fl i
is specified, all log entries are included.
.It Fl i Ar tag
Include log entries with the specified tag.
If neither
.Fl I
nor
.Fl i
is specified, all log entries are included.
.It Fl n
Specifies the name of the
.Nm varnishd
instance to get logs from.
If
.Fl n
is not specified, the host name is used.
.It Fl r Ar file
Read log entries from
.Ar file
instead of shared memory.
.It Fl V
Display the version number and exit.
.It Fl X Ar regex
Exclude log entries which match the specified regular expression.
.It Fl x Ar tag
Exclude log entries with the specified tag.
.El
.Sh EXAMPLES
The following example displays a continuously updated list of the most
frequently requested URLs:
.Bd -literal
varnishtop \-i RxURL
.Ed
.Pp
The following example displays a continuously updated list of the most
commonly used user agents:
.Bd -literal
varnishtop \-i RxHeader \-C \-I \\^User-Agent
.Ed
.Sh SEE ALSO
.Xr varnishd 1 ,
.Xr varnishhist 1 ,
.Xr varnishlog 1 ,
.Xr varnishncsa 1 ,
.Xr varnishstat 1
.Sh HISTORY
The
.Nm
utility was originally developed by
.An Poul-Henning Kamp Aq phk@phk.freebsd.dk
in cooperation with Verdens Gang AS and Linpro AS, and later
substantially rewritten by
.An Dag-Erling Sm\(/orgrav Aq des@des.no .
This manual page was written by
.An Dag-Erling Sm\(/orgrav Aq des@des.no .
......@@ -29,6 +29,11 @@ if test "x$XSLTPROC" = "xno"; then
AC_MSG_WARN([xsltproc not found – not building documentation])
fi
AM_CONDITIONAL(HAVE_XSLTPROC,[test "x$XSLTPROC" != "xno"])
AC_CHECK_PROGS(RST2MAN, [rst2man], "no")
if test "x$RST2MAN" = "xno"; then
AC_MSG_WARN([rst2man not found – not building man pages])
fi
AM_CONDITIONAL(HAVE_RST2MAN,[test "x$RST2MAN" != "xno"])
# Checks for libraries.
save_LIBS="${LIBS}"
......
......@@ -31,13 +31,16 @@ replies between the CLI socket and stdin/stdout.
OPTIONS
=======
-t timeout Wait no longer than this many seconds for an operation to finish.
-t timeout
Wait no longer than this many seconds for an operation to finish.
-S secret_file Specify the authentication secret file. This should be the same -S
argument as was given to varnishd. Only processes which can read
the contents of this file, will be able to authenticate the CLI connection.
-S secret_file
Specify the authentication secret file. This should be the same -S
argument as was given to varnishd. Only processes which can read
the contents of this file, will be able to authenticate the CLI connection.
-T address:port Connect to the management interface at the specified address and port.
-T address:port
Connect to the management interface at the specified address and port.
Available commands and parameters are documented in the varnishd(1)
......
......@@ -233,7 +233,8 @@ purge.list
purge.url regexp
Immediately invalidate all documents whose URL matches the specified regular expression.
quit Close the connection to the varnish admin port.
quit
Close the connection to the varnish admin port.
start
Start the Varnish cache process if it is not already running.
......@@ -247,7 +248,8 @@ stats
status
Check the status of the Varnish cache process.
stop Stop the Varnish cache process.
stop
Stop the Varnish cache process.
url.purge regexp
Deprecated, see purge.url instead.
......
......@@ -2,16 +2,16 @@
varnishhist
===========
-------------------------
Varnish request histogram
-------------------------
:Author: Dag-Erling Smørgrav
:Date: 2010-05-31
:Version: 1.0
:Manual section: 1
-------------------------
Varnish request histogram
-------------------------
SYNOPSIS
========
......
......@@ -2,16 +2,16 @@
varnishncsa
===========
---------------------------------------------------------
Display Varnish logs in Apache / NCSA combined log format
---------------------------------------------------------
:Author: Dag-Erling Smørgrav
:Date: 2010-05-31
:Version: 1.0
:Manual section: 1
---------------------------------------------------------
Display Varnish logs in Apache / NCSA combined log format
---------------------------------------------------------
SYNOPSIS
========
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment