My redis db runs out of memory after 2-3 day, I do flush manually. But, I want to fushall automatically in nodejs.
2
you should look why it happens at first place, maybe you could expire keys using tls check this link
Other option would be just set a cronjob to flush redis once in a while(not recommended)
Read about Redis’ maxmemory-policy and then choose one of the allkeys-* policies.
maxmemory-policy
allkeys-*
Click here to cancel reply.
2
Answers
you should look why it happens at first place, maybe you could expire keys using tls check this link
Other option would be just set a cronjob to flush redis once in a while(not recommended)
Read about Redis’
maxmemory-policy
and then choose one of theallkeys-*
policies.