I'm trying to figure out how to configure RabbitMQ + Erlang to have the smallest memory footprint possible at startup. Using RabbitMQ 3.13.6 and Erlang/OTP 26 (14.2.5.2) with Ubuntu i get about 50 Mb RSS, single cluster, minimal plugin list, no data whatsoever. But running it in a custom distrib like WindRiver, i get about 100 Mb. In the rabbitmq-diagnostics report i see the following:
Memory
Total memory used: 0.1066 gb
Calculation strategy: rss
reserved_unallocated: 0.0447 gb (41.95 %) <------
allocated_unused: 0.0 gb (0.0 %) <------
code: 0.0222 gb (20.82 %)
other_system: 0.0184 gb (17.31 %)
other_proc: 0.017 gb (16.0 %)
other_ets: 0.0023 gb (2.15 %)
atom: 0.0011 gb (1.03 %)
metrics: 0.0007 gb (0.67 %)
msg_index: 0.0002 gb (0.15 %)
metadata_store: 0.0001 gb (0.1 %)
mnesia: 0.0001 gb (0.07 %)
binary: 0.0001 gb (0.06 %)
plugins: 0.0 gb (0.04 %)
metadata_store_ets: 0.0 gb (0.03 %)
quorum_ets: 0.0 gb (0.02 %)
connection_other: 0.0 gb (0.0 %)
quorum_queue_procs: 0.0 gb (0.0 %)
quorum_queue_dlx_procs: 0.0 gb (0.0 %)
stream_queue_procs: 0.0 gb (0.0 %)
stream_queue_replica_reader_procs: 0.0 gb (0.0 %)
connection_readers: 0.0 gb (0.0 %)
connection_writers: 0.0 gb (0.0 %)
connection_channels: 0.0 gb (0.0 %)
queue_procs: 0.0 gb (0.0 %)
queue_slave_procs: 0.0 gb (0.0 %)
stream_queue_coordinator_procs: 0.0 gb (0.0 %)
mgmt_db: 0.0 gb (0.0 %)
Plugins
Enabled plugin file: /etc/rabbitmq/enabled_plugins
Enabled plugins:
* rabbitmq_stream
* rabbitmq_stream_common
* rabbitmq_amqp1_0
* amqp_client
I get extra 50 Mb preallocated memory from kernel but not used in the RabbitMQ/Erlang, and it won't go away in time.
Comparing the setup, binaries versions, Erlang VM run arguments, i could not find any difference. The only idea I have why the difference is there that for Ubuntu I get RMQ/Erlang binaries prebuilt and installed by package manager, for Windriver I had to compile it from the source.
Any ideas if I can tweak something in RabbitMQ/Elrang configuration to get rid of that preallocated memory? Also is it possible that binaries built from the source can cause this?
Thank you!