eclipse-mosquitto / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
9.01k stars 2.39k forks source link

Where are the broker topics and data stored? #1861

Closed ringmybell closed 3 years ago

ringmybell commented 3 years ago

Maybe this is too basic a question, but I have not found an answer.

Where does Mosquito store the broker topics and the data that is being passed to it? Is this stored in the systems RAM or is stored on the SD Card? Does changing any of the QOS, Retained and Last Will and Testament impact on where Mosquito saves the data? If data is being stored to the SD card can you force it to store on RAM?

I am running Mosquito on Raspberry Pi and concerned about SD card writes if subscribers are frequently publishing new data.

ralight commented 3 years ago

Mosquitto stores all data in memory, but can be configured to store to disk as well. This is done with the persistence option in the config file. By default persistence is only written infrequently, so even if you have it enabled it should not be a problem for SD card writes.

ringmybell commented 3 years ago

Super, thanks for clearing that up for me.