Hi there, we have Redis setup on AWS Linux server wherein i am facing some issues with the keys. I created keys using .NET core application as well as manually from the console and the key is getting removed automatically though i did not provided TTL while creation of the keys. Not sure why these keys are getting removed automatically, any help would be appreciated here.
Did you define an eviction policy, e.g. LRU?
@gkorland no, unless it has been set by default. How can I disable the LRU?
Can you run info
?
$ redis-cli info | grep maxmemory
maxmemory:0
maxmemory_human:0B
maxmemory_policy:noeviction
@gkorland This is what i am getting on console
I gave a command to run from the terminal not from redis-cli.
If you are running it from the redis-cli just run
> info memory
@gkorland values are matching already, please find screen shot below.
Strange…
Can you add a code example of how you write/update the keys?
@gkorland I am just using Redis cli to add keys as mentioned below in screenshot. And talking about .Net core application I am using _database.StringSetAsync(key, object, 24hrs) method to store the keys
It seems like you do set TTL for 24h
@gkorland I am setting TTL for 24 hours from .Net application but not when I create key manually from Redis cli and still both types of keys are getting removed automatically within an hour only. I never see key with time limit below 23 hour meaning keys created by .Net application are also getting removed within an hour.
hi @shripad.godse , from what I can see, there is no eviction policy so keys should not be deleted by Redis Stack database, RedisInsight also does not delete keys automatically.
The only thought that I have is that there is something within your set up that automatically deletes the keys.
Are the keys deleted all at once or only certain keys are deleted within an hour?
@ViktarStarastsenka All the keys are getting deleted. If I am missing something in setup what could it be? can you please elaborate if possible?
You use docker, right? I guess that if you do not use volumes, then all your data may be lost once the docker is re-started.
But I need more setup details here.
@ViktarStarastsenka Yes, we are using Docker on linux server and we tried creating new server with new setup still getting the same issue. We followed steps from this link.
Please find server details below, let me know what else you need to know.
Server Details:
Instance Type: Amazon Linux
VCPU: 1
RAM: 2GB
VOLUME: 8GB
@shripad.godse , did you run the $ docker run -v /local-data/:/data redis/redis-stack:latest
to persist your data?
a step from this document - Run Redis Stack on Docker | Redis
@ViktarStarastsenka yes, we did ran the command after some time though it is not working for us. Do we need to run anything after running docker run -v /local-data/:/data redis … command to persist data?
@ViktarStarastsenka we are able to see flushall command in profiler though, please find attached screen shot.
can you run the CLIENT LIST? you can use Workbench to see results in the table view (starting from RedisInsight 2.20)
there will be a list of clients, maybe this will help to detect the client that runs this command
@ViktarStarastsenka we updated Redis to be private and this issue seems to be fixed for now, thank you very much for your help.