Adding a feature to remove tanner-related sessions in redis-server on expiry
Lately we have been facing a problem on the snare side (mushorg/snare#180) due to default-tanner. According to @afeena it occurred because there are lot of sessions in the redis-server database which has consumed almost the complete memory capacity. This is because of the low memory of our default tanner server (Obviously it wasn't meant for production purpose). Due to this snare sessions were unable to be processed and stored in the same.
This gave me a thought, what if we build a new feature :
- Requires a new config parameter
expiry_timeto be present in tanner.config. - Use it to delete (tanner-created) sessions from redis-server after that 'expiry_time`.
- And this
expiry_timecan be configured based on the server-admin, depending on the duration of the history of data required and depending on the memory capacity of the server. - The deletion can be done periodically or in a lazy fashion depending on the implementation.
This is just a thought, looking for others opinions on the same :)
Yeah, I think auto-deleting based on memory is kinda must as we won't do that then it will just stop working.
What period would be suitable for deletion @viskey98 @rnehra01
It's good to keep the period as parameter.