Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Huge amount of rentained messages and restarting #77

Open
skinkie opened this issue Jan 12, 2024 · 6 comments
Open

Huge amount of rentained messages and restarting #77

skinkie opened this issue Jan 12, 2024 · 6 comments

Comments

@skinkie
Copy link

skinkie commented Jan 12, 2024

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
Copy link
Owner

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.

@ben-auo
Copy link

ben-auo commented Sep 15, 2024

+1

Persistence like https://nanomq.io/docs/en/latest/rule/config-file.html#data-persistence-with-sqlite with the option to republish a topic would be awesome

@bigsmoke
Copy link
Contributor

bigsmoke commented Sep 15, 2024

Just a note: there are a couple of new contenders for in-process databases that might be worth checking out before defaulting to SQLite:

This is a preliminary list, without having, for instance, done any license compatibility analysis.

@skinkie
Copy link
Author

skinkie commented Sep 15, 2024

I am kind of a heavy DuckDB user ;-) The problem with DuckDB is that it is in principle single threaded access. That is not a problem if the inter process communication is handled within the application and the database access can be handled with just one thread. That having said, DuckDB has transparant compression support, which is pretty neat.

@ben-auo
Copy link

ben-auo commented Sep 15, 2024

worth checking out before defaulting to SQLite

Oh yes, definitely. That was just a quick example that came to mind. Some other ideas:

@bigsmoke
Copy link
Contributor

I've spoke with @halfgaar about this a couple of times recently, and persistence options for retained messages are something that he very much wants to maul over for some time before committing to any particular approach. This is something to get right off the bat, especially because one of the architectural goals for FlashMQ is to keep the number of dependencies to an absolute minimum. (Recently, we even got rid of an external DocBook→groff tool dependency for generating the man pages.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants