---

lv:
  data:
    pv: '/dev/sdb1'
    vg: 'rabbitmq'

mount:
  /mnt/apt:
    disk: '/dev/mapper/rabbitmq-data'
    govuk_lvm: 'data'
    mountoptions: 'defaults'

rabbitmq::config_kernel_variables:
  'inet_dist_listen_min': '9100'
  'inet_dist_listen_max': '9105'
rabbitmq::config_mirrored_queues: true
rabbitmq::config_cluster: true
rabbitmq::cluster_node_type: 'disc'
rabbitmq::cluster_nodes:
  - 'rabbitmq-1'
  - 'rabbitmq-2'
  - 'rabbitmq-3'
rabbitmq::erlang_cookie: 'EOKOWXQREETZSHFNTPEY'
rabbitmq::wipe_db_on_cookie_change: true

---

lv:
  data:
    pv: '/dev/sdb1'
    vg: 'rabbitmq'

mount:
  /mnt/apt:
    disk: '/dev/mapper/rabbitmq-data'
    govuk_lvm: 'data'
    mountoptions: 'defaults'

rabbitmq::config_cluster: true
rabbitmq::config_kernel_variables:
  'inet_dist_listen_min': '9100'
  'inet_dist_listen_max': '9105'
rabbitmq::config_mirrored_queues: true
rabbitmq::config_variables:
  'vm_memory_high_watermark': '0.8'
rabbitmq::cluster_node_type: 'disc'
rabbitmq::cluster_nodes:
  - 'rabbitmq-1'
  - 'rabbitmq-2'
  - 'rabbitmq-3'
rabbitmq::erlang_cookie: 'EOKOWXQREETZSHFNTPEY'
rabbitmq::wipe_db_on_cookie_change: true

Increase RabbitMQ `vm_memory_high_watermark` to 80%
Increase RabbitMQ `vm_memory_high_watermark` to 80%

The `vm_memory_high_watermark` is a fractional value. It tells
RabbitMQ at which fraction of (total) memory usage to start
aggressively writing queued messages to disk or to use up the page
file. Whilst it does this, it also blocks publishing from client
connections. This watermark is triggered across the cluster, not just
per-node.

Our RabbitMQ nodes are dedicated to running RabbitMQ. The default
value for `vm_memory_high_watermark` is 40% (1.5GB of RAM on a 4GB RAM
VM). We should increase this value so that our cluster continues to
operate for much longer as it has the memory to do so.

For more information on this, see:

 - https://www.rabbitmq.com/memory.html#memsup
 - https://www.rabbitmq.com/configure.html#config_items
