Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis keys are getting deleted automatically

Tags:

java

redis

jedis

We are using redis as caching. There were cases when some of the keys were getting deleted and we couldn't find the reason. I put redis keyspace/keyevent for CONFIG SET notify-keyspace-events KEgxe on this notification I am putting logs. But neither I can find in my core-logs nor in this redis-logs for some keys. They have some data in RDBMS, so we are sure that those keys must have come into Redis. We are very much into lost state, on what basis should we debug this.

Redis info says it has ~100mb in usage, which looks ok to me. How to persist data and keys.

like image 903
theGamblerRises Avatar asked Nov 28 '25 17:11

theGamblerRises


1 Answers

2 possible reasons:

  1. the client failed to write to Redis
  2. some client deletes these missing keys

You can try to subscribe everything about key changes: CONFIG SET notify-keyspace-events AKE, and log these changes into logs to figure out the problem.

like image 72
for_stack Avatar answered Nov 30 '25 07:11

for_stack



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!