0

I'm using

  • Redis 2.2.12
  • django-redis==3.8.4
  • django 1.7

settings.py

CACHES = {
"default": {
    "BACKEND": "django_redis.cache.RedisCache",
    "LOCATION": "redis://127.0.0.1:6379/",

} }

python manage.py shell

from django.core.cache import cache
cache.set('key','value',300000)
cache.get('key')
>>value

but after sudo service redis-server restart

from django.core.cache import cache
cache.get('key')
>>NOTHING

with redis-cli same issue

redis 127.0.0.1:6379> set key value
OK
redis 127.0.0.1:6379> keys *
1) "key"

but after sudo service redis-server restart

redis 127.0.0.1:6379> keys *
(empty list or set)

its flushing data when redis reload or restart

i Saw that i can manually call SAVE or BGSAVE to stay hot upon server restart. in redis-cli its working fine . How on django-redis ?

Anish Menon
  • 789
  • 11
  • 26
  • 1
    Do you realize that this is intented behaviour? Are you interested in configuring redis to persist data? – Wtower Oct 29 '15 at 09:24
  • @Wtower . AOF persistence logs every write operation received by the server but its Slow right ? is there any alternative – Anish Menon Oct 29 '15 at 09:33
  • It's not that slow. Only if you fsync every write. One second sync you will hardly notice. You can test it with `redis-benchmark` – Joe Doherty Oct 29 '15 at 15:07

0 Answers0