lorawan-server icon indicating copy to clipboard operation
lorawan-server copied to clipboard

Purge database size for events also

Open hallard opened this issue 6 years ago • 11 comments

We need to decrease database size, on multitech GW with lot of devices, sometime admin interface does not answer anymore until we delete the following files:

  • event.DLC and event.DCD
  • rxframe.DLC and rxframe.DCD
  • LATEST.LOG

As asked in decrease database size #601 We understand we can use parameter

 % amount of rxframes retained for each device/node
    {retained_rxframes, 50},

Is there something similar for events ?

Thansks

hallard avatar Mar 06 '19 10:03 hallard

Yes, there is: {event_lifetime, 86400}. The number means how many seconds is an event displayed before it gets deleted.

gotthardp avatar Mar 06 '19 15:03 gotthardp

Looks like #601 I setup this parameter to 3600 and still have events from 2hours, could it be a localtime or timezone issue? I've purged both from web interface. Can we purge thru API until it's fixed?

hallard avatar Mar 27 '19 12:03 hallard

this is really weird, will have a look

the API allows you to delete all entries in a table (that's what the purge buttons do). simply HTTP DELETE /api/events, but be careful-- it deletes everything without any warning and any way to recover (that's why its not documented)

gotthardp avatar Mar 27 '19 15:03 gotthardp

:( Il mer 27 mar 2019, 16:10 Petr Gotthard [email protected] ha scritto:

this is really weird, will have a look

the API allows you to delete all entries in a table (that's what the purge buttons do). simply HTTP DELETE /api/events, but be careful-- it deletes everything without any warning and any way to recover (that's why its not documented)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gotthardp/lorawan-server/issues/606#issuecomment-477201053, or mute the thread https://github.com/notifications/unsubscribe-auth/ABdhaoypjwuxc_03538mI6Rl2Kl6G4scks5va4n_gaJpZM4bgk5f .

autodomain avatar Mar 27 '19 15:03 autodomain

@hallard To further debug this issue I made the following updates to the latest master:

  • I added new config parameter {trim_interval, 3600} to define how often (in seconds) is the database trimmed. Note that if you say {event_lifetime, 3600} and {trim_interval, 3600} your events will never be older than 2 (two!) hours.
  • Upon startup the system (debug) prints Using config: following a list of config parameters to make sure nothing was misspelled not misplaced.

gotthardp avatar Mar 27 '19 16:03 gotthardp

@gotthardp Thanks, I'll try this one setting both to 1800 to see, but not today, we need to finalise production by the end of day

hallard avatar Mar 27 '19 16:03 hallard

@gotthardp

Looks like still not working for RX frames

    % amount of rxframes retained for each device/node
    {retained_rxframes, 10},
    % events duration on interface
    {event_lifetime, 1800},
    {trim_interval, 1800},

Frames pages 458 frames image

Most recent before image

Older before (2 days ago) image

Events looks better despite the fact there are 3 old events but all other are fine image

hallard avatar Mar 29 '19 13:03 hallard

Concerning the events: please see the Last Occurred date. There are no old events.

gotthardp avatar Mar 29 '19 16:03 gotthardp

Concerning the Frames: what you posted is not necessarily wrong, could you please (wait 1800 seconds after server start and then) filter out only one DevAddr? Is there a DevAddr that has more than a high number of old frames or not?

gotthardp avatar Mar 29 '19 18:03 gotthardp

Hi,

It's possible to remove all received frames, removing rxframe.DLC and rxframe.DCD ? Can I remove this with loraserver running ??

What is the best procedure ? Because my rxframes page does not load......

jot4p avatar Jul 29 '20 16:07 jot4p

Dear @gotthardp is it safe to remove rxframe.DLC and rxframe.DCD ? Or to configure retained_rxframes=0? Thank you for your reply.

JoobyPM avatar Dec 15 '22 07:12 JoobyPM