Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have set up memcached in Django using Pylibmc binding:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
        'LOCATION': ['10.241.1.1:11211',
                    '10.241.1.2:11211',]
    }
}

I tested on server with django shell, and the memcached pool workse for getting and setting values in memcached. But when I try to set

SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"   OR
SESSION_ENGINE = "django.contrib.sessions.backends.cache"

my website can still be accessed, but halts when user pressed login button. So I guess this must be the problem with session backend. My website works fine by using database as session backend. I cannot find any related error in apache or website error log, and /var/log/memcached.log is empty.

Reference: https://docs.djangoproject.com/en/1.1/topics/http/sessions/

share|improve this question

1 Answer 1

I guess this is a bug of Pylibmc, although the reason of the bug is still unknown. The weired thing is that when I tried the same code in management/commands/, it works just fine. But I can't even cache.set(key, value) in views, which will cause the page to halt.

So I switched back to python-memcached, and it works.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.