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
Unexpected growth in the .db file #389
Comments
The first thing to look at would be what is actually in the persistence file - you could use the mosquitto_db_dump to take a look: https://github.com/eclipse/mosquitto/tree/master/src/db_dump It might require some fiddling with the db_dump source to find out exactly what is happening. |
Do you still experience this issue ? |
Yes, sorry I haven't analysed it yet. Will do so and send you something over the next two weeks. Is that Okay? Sorry lots of other priorities on going at the moment.
…________________________________
From: Pierre Fersing <[email protected]>
Sent: Friday, January 5, 2018 10:38:08 PM
To: eclipse/mosquitto
Cc: Ashish Bajaj; Author
Subject: Re: [eclipse/mosquitto] Unexpected growth in the .db file (#389)
Do you still experience this issue ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#389 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AEs6yJ408JjbaoiMNuzcnKiTB9X1pKKzks5tHlb4gaJpZM4ML7a9>.
|
Hi, I am having similar issue. The db file is growing quickly, I have to manualy delete it every 7-10 days. |
try harder to compile the db dump tools. You probably have a persistent client with a subscripion thhat you didn't intend. An option that can be very useful to aovid this is |
@pjchx Try the following:
If you have errors, report them here and we'll help - but try and install missing tools first if you can. |
hi, I managed somehow to compile on rPi running Jessie. The another rPi running Wheezy (and mosquitto client) compilation did not work. Now the dump tool is working. However I deleted the big file yesterday so I have to wait until it builds up again in few days. Then I will analyse.Thanks for the help so far. p.s. line 192 for(int i=0; ipayloadlen; i++) I moved the the i variable definition before the loop. |
Actually I may have isolated the problem. If you're comfortable with compiling the whole mosquitto source, then try:
If you need websockets, then run |
Hi, my file has just grown again to 230MB root@xxx:/opt/mosquitto-master/src/db_dump# ./mosquitto_db_dump --stats mosquitto.db on --client.stats parameter ...it returns nothing. in my mosquitto.conf I have the following parameters Is it possible that due to the the persistence true parameter the in-memory database content is "appended" to mosquitto.db on disk and that is why it is growing ? thanks for helping on this. |
...one more thing.
I tried to compile on my Wheezy but no luck:
|
The problem isn't an append, it is that in some circumstances some messages were being persisted even when they weren't in use, and then never being freed. This is fixed in the latest release. I'm sorry, but wheezy is about 9 months past its end of life, it's not supported by Debian and not supported by the Mosquitto project either. Having said that, if you just want the broker then try:
This will build just the broker, which should be ok I think. |
I have a broker configured with the following settings:
Further I have a phone client that connects over websocket interface with a fixed unchanged clientid each time, and sets up its cleanSessionFlag to true, so its not a persistent session.
But after every such connection and disconnection, I see the mosquitto.db file growing. On opening the db file in an editor, I see multiple sections of data for each of the connections.
But if the cleanSessionFlag is set to false, the file doesn't grow - there is only one instance of the clientid maintained. But as expected I do receive all the QoS 1 and QoS2 retained messages that I may have missed during the time I didn't have connection. I dont want any of those messages delivered to the client, which is why I changed my client to connect using cleanSessionFlag to false.
This is not something expected right? I am on mosquitto 1.4.10...is there any known issue?
Let me know if you need any logs?
The text was updated successfully, but these errors were encountered: