Loraserver Database increasing size

Hi,

Currently I am using the loraserver and lora_app_server and it is already working for more than a year without a problem. I am very happy with all the loraserver.io. Great Job Brocaar!

At the moment we are also increasing the amount of lora sensors a lot and I see that my Postgresql database ‘loraserver_ns’ keeps on growing and growing. At the moment the database is around 20GB.

I don’t know exactly what is stored in the database, but I guess al lthe messages that have been received? Is there a possibility to clean up the database in a way that I only store the data of the last 30 days?
Should I perform a manual SQL query maybe?

If I take a look at the database with PGAdmin (Postgresql tool for windows) I do not really see what is inside…

I am looking forward to your thoughts about this subject.
Thanx in advance.
Sjef

It depends which version you’re running. Please note that the frame-logs used to be stored in the database, which was removed exactly because of this reason (and you had to refresh each time). LoRa (App) Server v2 includes a lot of cleanups at the database-side (unused indices, cleanup of unused db tables), so you might want to give it a shot :slight_smile:

With LoRa Server v2 the only thing that might consume a lot of storage are the gateway statistics. To prune old stats, see: https://www.loraserver.io/loraserver/features/gateway-management/.

Hi Brocaar,

Well, you are right. My frame-logs table consumes most of the GBs. It is 15GBs on data an d 2 GB on indexes. And the other 3 GB is consumed by the gateway_stats table.

I am currently developing a new application on a new server in which I will use Lora Server V2 so great to hear that it will be no problem for me in the future. Until that time, I don’t want to bother my working server with updates on it. Maybe it doesn’t go down, maybe it does… It is working right now and receiving a lot of message and I want to keep receiving them until we will switch over to the new server and application.

I expect it can do no harm to the LoraServer to just delete a lot of old rows in the frame_logs table? Or does it influence the behaviour on the server in any way? Are the logs linked to anything that can make the server go down? (Because I am precautios with it)

Truncating the frame-logs table should not affect the functioning of LoRa Server :slight_smile:

Great! I will start to clean up my database table :smiley:

Hi Brocaar,
I have installed LoRa server using docker compose and everything is running very well. I have tried pgAdmin III to access the postgresql database by giving the default username loraserver_as and loraserver_as as password with the default port number 5432. When i tried to connect it, it chows fatal error: password authentication failed for user “loraserver_ns”
FATAL: password authentication failed for user “loraserver_ns”
Do you have any idea?

1 Like