---
name: "ocf_heartbeat_varnish"
section: "7"
platform: "linux"
package: "resource-agents"
version: "1:4.16.0-3+deb13u2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ocf_heartbeat_varnish"
---

# ocf\_heartbeat\_varnish(7)

Manage a Varnish instance

## NAME

ocf\_heartbeat\_varnish - Manage a Varnish instance

## SYNOPSIS

**varnish** \[start \| stop \| status \| monitor \| meta-data \| validate-all\]

## DESCRIPTION

The Varnish Resource Agent can manage several varnishd instances throughout the cluster. It does so by creating a unique PID file and requires a unique listen address and name for each instance.

## SUPPORTED PARAMETERS

**config**

The VCL configuration file that Varnish should manage, for example "/etc/varnish/default.vcl".

(unique, required, string, no default)

**name**

Override the name of the instance that should be given to Varnish (defaults to the resource identifier).

(unique, optional, string, default "RESOURCE\_ID")

**pid**

Write the process's PID to the specified file. The default will include the specified name, i.e.: "/var/run/varnish\_production.pid". Unlike what this help message shows, it is most likely not necessary to change this parameter.

(unique, optional, string, default "/var/run/varnishd\_RESOURCE\_ID.pid")

**listen\_address**

Listen on this address:port, for example "192.168.1.1:80"

(unique, optional, string, default "0.0.0.0:80")

**mgmt\_address**

Provide a management interface, for example "127.0.0.1:2222"

(unique, required, string, no default)

**ttl**

Specify a hard minimum time to live for cached documents.

(optional, integer, default 600)

**varnish\_user**

Specify the name of an unprivileged user to which the child process should switch before it starts accepting connections.

(optional, string, default "varnish")

**varnish\_group**

Specify the name of an unprivileged group to which the child process should switch before it starts accepting connections.

(optional, string, default "varnish")

**backend\_type**

Use the specified storage backend. Valid options are 'malloc' for memory and 'file' for a file backend.

(optional, string, default "malloc")

**backend\_size**

Specify the size of the backend. For example "1G".

(optional, string, default "1G")

**backend\_file**

Specify the backend filename if you use backend\_type file. For example /var/lib/varnish/mybackend.bin

(unique, optional, string, default "/var/lib/varnish/RESOURCE\_ID.bin")

**threads\_pools**

Number of worker thread pools. Each pool has the minimum, maximum and timeout values configured in the thread\_pool\_min, thread\_pool\_max and thread\_pool\_timeout parameters

(optional, string, default "2")

**thread\_pool\_min**

Start at least min but no more than max worker threads with the specified idle timeout in each pool.

(optional, string, default "100")

**thread\_pool\_max**

Start at least min but no more than max worker threads with the specified idle timeout in each pool.

(optional, string, default "3000")

**thread\_pool\_timeout**

Start at least min but no more than max worker threads with the specified idle timeout in each pool.

(optional, string, default "120")

**client\_binary**

This is used to control Varnish via a CLI. It's currently only used to check the status of the running child process.

(optional, string, default "varnishadm")

**maxfiles**

Maximum number of open files (for ulimit -n)

(optional, string, default "131072")

**max\_locked\_memory**

Locked shared memory limit (for ulimit -l)

(optional, string, default "82000")

**secret**

Path to a file containing a secret used for authorizing access to the management port.

(optional, string, default "/etc/varnish/secret")

## SUPPORTED ACTIONS

This resource agent supports the following actions (operations):

**start**

Starts the resource. Suggested minimum timeout: 20s.

**stop**

Stops the resource. Suggested minimum timeout: 20s.

**monitor**

Performs a detailed status check. Suggested minimum timeout: 20s. Suggested interval: 10s.

**status**

Performs a status check. Suggested minimum timeout: 20s.

**meta-data**

Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5s.

**validate-all**

Performs a validation of the resource configuration. Suggested minimum timeout: 20s.

## EXAMPLE CRM SHELL

The following is an example configuration for a varnish resource using the [**crm**(8)](/crm/8.md) shell:

```
primitive p_varnish ocf:heartbeat:varnish \
  params \
    config=string \
    mgmt_address=string \
  op monitor timeout="20s" interval="10s" depth="0"
```

## EXAMPLE PCS

The following is an example configuration for a varnish resource using [**pcs**(8)](/pcs/8.md)

```
pcs resource create p_varnish ocf:heartbeat:varnish \
  config=string \
  mgmt_address=string \
  op monitor timeout="20s" interval="10s" OCF_CHECK_LEVEL="0"
```

## SEE ALSO

**http://clusterlabs.org/**

## AUTHOR

**ClusterLabs contributors (see the resource agent source for information about individual authors)**
