Configuration files

The LavinMQ configuration file contains server and broker settings. This documentation will describe the configuration file and how different settings can be configured.

What is the LavinMQ configuration file?

Most settings in LavinMQ can be tuned using the configuration file. The structure of the configuration file is INI and comprises key-value pairs for properties and sections that organize the properties. The sections are split into four; one [main] section, one for the LavinMQ Management Interface [mgmt], one for [amqp], one for [clustering]. The syntax can be explained as:

  • One setting uses one line
  • Lines are structured Key = Value
  • Any line starting with the ; character indicates a comment

Where is the configuration file located?

The default configuration file location is under /etc/lavinmq

How do config changes take effect?

Changes to the configuration file will be applied after a restart of LavinMQ.

Configurations

The LavinMQ configuration file is divided into four different sections, main, amqp, mgmt and clustering. The tables below outlines the different configurations available for LavinMQ, their default value, and examples.

[main]

consumer_timeout Default consumer timeout for acks.

Default: consumer_timeout = nil
data_dir The path of the data directory where all data is stored.

Default: data_dir = /var/lib/lavinmq
data_dir_lock Use file lock in the data directory

Default: true
default_consumer_prefetch Default prefetch value for consumers if not set by consumer.

Default: default_consumer_prefetch = 65535
free_disk_min The minimum value of free disk space in bytes before LavinMQ starts to control flow.

[main] free_disk_min
free_disk_warn The minimum value of free disk space in bytes before LavinMQ warns about low disk space.

[main] free_disk_warn
guest_only_loopback Limit guest user to only connect from loopback address.

Default: guest_only_loopback = true
log_exchange Enable log exchange

Default: false
log_file Path to file log file. If no path is set, log is written to STDOUT.

Default: nil
log_level Controls how detailed the log should be. The level can be one of:
  • none (nothing is logged)
  • fatal (only fatal errors are logged)
  • error (fatal and errors are logged)
  • warn (fatal, errors and warnings are logged)
  • info (fatal, errors, warnings, and info messages are logged)
  • debug (all messages are logged).


Default: log_level = info
max_deleted_definitions Number of deleted queues, unbinds etc that compacts the definitions file.

Default: max_deleted_definitions = 8192
segment_size Size of segment files.

Default: segment_size = 8388608
set_timestamp Boolean value for setting the timestamp property.

Default: set_timestamp = false
socket_buffer_size Socket buffer size in bytes.

Default: socket_buffer_size = 16384
stats_interval Statistics collection interval in milliseconds.

Default: stats_interval = 5000
stats_log_size Number of entries in the statistics log file before oldest entry removed.

Default: stats_log_size = 120
tcp_keepalive tcp_keepalive settings as a tuple, {idle, interval, probes/count}.

Default: tcp_keepalive = {60, 10, 3}
tcp_nodelay Boolean value for disabling Nagle's algorithm, and sending the data as soon as it's available.

Default: tcp_nodelay = false
tcp_recv_buffer_size TCP receive buffer size.

Default: tcp_recv_buffer_size = nil
tcp_send_buffer_size TCP send buffer size.

Default: tcp_send_buffer_size = nil
tls_cert TLS certificate (including chain).

Example: tls_cert = /etc/lavinmq/cert.pem
tls_key Private key for the TLS certificate. Example: ls_key = /etc/lavinmq/key.pem
tls_ciphers List of TLS ciphers to allow
Example:
tls_min_version Minimum allowed TLS version. Allowed options:
  • 1.0
  • 1.1
  • 1.2
  • 1.3

Default: tls_min_version = 1.2

[mgmt]

bind IP address that the HTTP server will listen on.

Default: bind = 127.0.0.1
port Port used for connections.

Default: port = 15672
systemd_socket_name Default: systemd_socket_name = lavinmq-http.socket
tls_port Port used for TLS connections.

Default:
tls_port = -1
unix_path UNIX path to listen to

Default: unix_path = /tmp/lavinmq-http.sock

[amqp]

bind IP address that both the AMQP and HTTP servers will listen on.

Default: bind = 127.0.0.1
channel_max Maximum number of channels to negotiate with clients. Setting to 0 means an unlimited number of channels.

Default: channel_max = 2048
frame_max Maximum frame size in bytes.

Default: frame_max = 1048576
heartbeat Timeout value in seconds suggested by the server during connection negotiation. If set to 0 on both server and client, heartbeats are disabled.

Default: Heartbeat = 0
max_message_size The maximum message size in bytes.

Default: max_message_size = 128 * 1024**2
port Port used for connections

Default: port = 5672
systemd_socket_name Default: systemd_socket_name = lavinmq-amqp.socket
tcp_proxy_protocol Boolean value for PROXY protocol on amqp tcp connections

Default: tcp_proxy_protocol = false
tls_port Port used for TLS connections.

Default: tls_port = 5671
unix_path UNIX path to listen to

Default: unix_path = /tmp/lavinmq.sock
unix_proxy_protocol Boolean value for PROXY protocol on unix domain socket connections

Default: unix_proxy_protocol = true

[clustering]

advertised_uri Advertised URI for the clustering server.

Default: nil
bind Listen for clustering followers on this address.

Default: 127.0.0.1
enabled Enable clustering.

Default: false
etcd_endpoints Comma separated host:port pairs

Default: localhost:2379
etcd_prefix Key prefix used in etcd.

Default: lavinmq
max_unsynced_actions Maximum number of unsynced actions.

Default: 8192
port Listen for clustering followers on this port.

Default: 5679

Example configuration file

An example of a configuration file can be found at GitHub.

Ready to take the next steps? Here are some things you should keep in mind:

Managed LavinMQ instance on CloudAMQP

LavinMQ has been built with performance and ease of use in mind - we've benchmarked a throughput of about 1,000,000 messages/sec. You can try LavinMQ without any installation hassle by creating a free instance on CloudAMQP. Signing up is a breeze.

Help and feedback

We welcome your feedback and are eager to address any questions you may have about this piece or using LavinMQ. Join our Slack channel to connect with us directly. You can also find LavinMQ on GitHub.