OCF_HEARTBEAT_VARNIS(7)

✨ OCF_HEARTBEAT_VARNIS ✨

okay bestie, welcome to the OCF_HEARTBEAT_VARNIS(7) page, aka the group chat where we talk about the Varnish resource agent πŸ’… this is section 7 of the manual, and it's literally all about managing a Varnish instance like a boss πŸ‘‘


🌸 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 all over the cluster. no cap. 🫢

The way it pulls this off? It creates a unique PID file for each one, and it needs a unique listen address and a unique name for every single instance. so like… don't reuse them, okay? πŸ™ˆ


πŸ”₯ SUPPORTED PARAMETERS πŸ”₯

  • config β€” the VCL configuration file that Varnish should manage, for example "/etc/varnish/default.vcl". πŸ“

(unique, required, string, no default)

  • name β€” overrides the name of the instance that should be given to Varnish. if you don't set it, it defaults to the resource identifier. ✨

(unique, optional, string, default "RESOURCE_ID")

  • pid β€” writes the process's PID to the specified file. the default will include the name you specified, like "/var/run/varnish_production.pid". and ngl, even though this help message makes it sound like a whole thing, it is most likely not necessary to change this parameter. leave it alone bestie πŸ’…

(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 that the child process should switch to before it starts accepting connections. 🫢

(optional, string, default "varnish")

  • varnish_group β€” specify the name of an unprivileged group that the child process should switch to 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), and yes, every single one of them is iconic in its own way:

  • 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 🌈

here's an example configuration for a varnish resource using the crm(8) shell, screenshot this πŸ“Έ:

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

πŸ’œ EXAMPLE PCS πŸ’œ

and here's an example configuration for a varnish resource using pcs(8), because we love options:

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 ⭐


πŸŽ€ AUTHOR πŸŽ€

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


and that's the whole page bestie, you ate it up fr fr πŸ’…

resource-agents Β· version UNKNOWN Β· dated 04/08/2026 β€” mwah, see you in the next manpage πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from