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 three; one [main] section, one for the LavinMQ Management Interface [mgmt], and one for [amqp]. 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 table below outlines the different configurations available for LavinMQ, their default value, and example.

data_dir The path of the data directory where all data is stored.

Default: data_dir = /var/lib/lavinmq
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
file_buffer_size File buffer size in bytes.

Default: file_buffer_size = 16384
socket_buffer_size Socket buffer size in bytes.

Default: socket_buffer_size = 16384
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
tls_compability_mode Boolean value to enable TLS 1.0 and 1.1 and old cipher suites

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

Default:
[amqp] tls_port = 5671
[mgmt] tls_port = 15671
port Port used for connections

Default:
[amqp] port = 5672
[mgmt] port = 15672
bind IP address that both the AMQP and HTTP servers will listen on.

Default:
[amqp] bind = 127.0.0.1
[mgmt] bind = 127.0.0.1
unix_path UNIX path to listen to

Default:
[amqp] unix_path = /tmp/lavinmq.sock
[mgmt] unix_path = /tmp/lavinmq-http.sock
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
gc_segments_interval How often to garbage collect message segments in seconds.

Default: gc_segments_interval = 60
segment_size
queue_max_acks Compact/GC queue indexes after this many acked messages.

Default: queue_max_acks = 2_000_000
set_timestamp Boolean value for setting the timestamp property.

Default: set_timestamp = false
tcp_nodelay Boolean value for disabling Nagle's algorithm, and sending the data as soon as it's available.

Default: tcp_nodelay = false
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
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
tcp_proxy_protocol Boolean value for PROXY protocol on amqp tcp connections

Default: tcp_proxy_protocol = false
unix_proxy_protocol Boolean value for PROXY protocol on unix domain socket connections

Default: unix_proxy_protocol = true
systemd_socket_name Default:
[amqp] systemd_socket_name = lavinmq-amqp.socket
[mgmt ] systemd_socket_name = lavinmq-http.socket
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
max_message_size The maximum message size in bytes.

Default: max_message_size = 128 * 1024**2

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.