I’m running HiveMQ CE on a CentOS 7 machine for a SaaS business with >15k connected MQTT devices and am noticing that the hard drive is creeping up to 100% usage. I have ruled out typical file bloat sources (/var/log, etc) and have proper log rotation implemented.
I discovered a ton of large log files under the /data/persistence/retained_messages/ directory; it seems that HiveMQ is doing a dump of some sort of statistics, as shown in the quote below.
My MQTT configuration is shown below; how can I disable the generation of these log files, or at least clean them out with logrotate?
It would also be good to provide high level information about your scenario, especially how many retained messages (topic structure, qos level, payloadsize) do you have?
P.S.: As a workaround for “retained-publish-ttl” a PublishInboundInterceptor to change the expiry for a retained message can be used.
Thanks, it does look like configuration syntax might be the issue here. I’m running version 2020.3.
All of our connected devices are MQTT 3.0 clients connecting with a clean session. They’re sending small payloads (typically ~100 byte payloads, up to 1K in some cases). They are Publishing with a QoS of 0, and typically send data to topics that are segmented by our client (100-500 devices per topic). There is one master topic that accepts heartbeats from all connected devices, approximately 2 msg/min per device (<20k devices total, so around 50-70 messages per second).
Please correct me if I’m wrong, but I understand that MQTT 3.0 clients can’t specify a retained message publish TTL, so the PublishInboundInterceptor should not be needed?
do I understand correctly that you are not using retained messages?
Please correct me if I’m wrong, but I understand that MQTT 3.0 clients can’t specify a retained message publish TTL, so the PublishInboundInterceptor should not be needed?
HiveMQ CE treats all packets internally as MQTT 5 packets, this means you can set a message expiry for any incoming MQTT 3 Publish packet.
Here is an example that would add an expiry to all incoming retained messages:
do I understand correctly that you are not using retained messages?
Correct. Our data is considered stale very quickly, so I’m intending for HiveMQ to not persist any messages.
We don’t have full control over the firmware on all of our connected devices, so it sounds like the interceptor extension would be best for us to guarantee the behavior of the system. Thanks for the reference example, very helpful.