halfgaar / FlashMQ

FlashMQ is a fast light-weight MQTT broker/server, designed to take good advantage of multi-CPU environments
https://www.flashmq.org/
Open Software License 3.0
173 stars 24 forks source link

Huge amount of rentained messages and restarting #77

Open skinkie opened 5 months ago

skinkie commented 5 months ago

The last action upon a restart is saving retained messages to /var/lib/flashmq/retained.db, would it be possible to do this in a different way, since it takes quite long to write it. In addition to it, it looks that flashmq needs a whopping 6GB of RAM, and my expectation is that this is mostly due to these retained messages, any chance to offload this?

halfgaar commented 5 months ago

For both issues, it would probably require integration with some kind of storage specific software, like something SQL based (Sqlite maybe). And then in such a way so that it's not a build-time requirement. Also, some kind of change tracking would have to be implemented.

I'll think about some solutions, perhaps intermediate ones as well.