Discussion:
memcached not working with django
tino
2011-10-07 13:10:51 UTC
Permalink
Hello,

I am trying to implement memcached on my django site.
# telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
stats
STAT pid 22537
STAT uptime 31523
STAT time 1317992962
STAT version 1.4.5
STAT pointer_size 64
STAT rusage_user 0.000000
STAT rusage_system 0.000000
STAT curr_connections 10
STAT total_connections 41
STAT connection_structures 11
STAT cmd_get 0
STAT cmd_set 0
STAT cmd_flush 0
STAT get_hits 0
STAT get_misses 0
STAT delete_misses 0
STAT delete_hits 0
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 190
STAT bytes_written 23756
STAT limit_maxbytes 67108864
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT bytes 0
STAT curr_items 0
STAT total_items 0
STAT evictions 0
STAT reclaimed 0
END

As you can see the cmd_get value is 0 in telnet stats. Can anybody
please advice?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com.
To unsubscribe from this group, send email to django-users+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Henrik Genssen
2011-10-07 13:20:22 UTC
Permalink
did you read and follow this?
https://docs.djangoproject.com/en/1.3/topics/cache/

depending on what you want to do, you need:
- entry in settings.py
- python-memcached and pylibmc => otherwise caching fails silently
- cache-middleware or cache_page decorator

regrads

Henrik
date: 07.10.2011 08:10:51
subject: [<django-users.googlegroups.com>] memcached not working with django
Hello,
I am trying to implement memcached on my django site.
# telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
stats
STAT pid 22537
STAT uptime 31523
STAT time 1317992962
STAT version 1.4.5
STAT pointer_size 64
STAT rusage_user 0.000000
STAT rusage_system 0.000000
STAT curr_connections 10
STAT total_connections 41
STAT connection_structures 11
STAT cmd_get 0
STAT cmd_set 0
STAT cmd_flush 0
STAT get_hits 0
STAT get_misses 0
STAT delete_misses 0
STAT delete_hits 0
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 190
STAT bytes_written 23756
STAT limit_maxbytes 67108864
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT bytes 0
STAT curr_items 0
STAT total_items 0
STAT evictions 0
STAT reclaimed 0
END
As you can see the cmd_get value is 0 in telnet stats. Can anybody
please advice?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com.
To unsubscribe from this group, send email to django-users+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
TINO THOMAS
2011-10-07 14:11:44 UTC
Permalink
Thank you Henrik for your help.
I have already given the following entry in settings.py for python-memcached
binding

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}

What should i do next , if i want to get a pers-site cache? . Sorry i am a
newbie in this.
Post by Henrik Genssen
did you read and follow this?
https://docs.djangoproject.com/en/1.3/topics/cache/
- entry in settings.py
- python-memcached and pylibmc => otherwise caching fails silently
- cache-middleware or cache_page decorator
regrads
Henrik
date: 07.10.2011 08:10:51
subject: [<django-users.googlegroups.com>] memcached not working with
django
Hello,
I am trying to implement memcached on my django site.
# telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
stats
STAT pid 22537
STAT uptime 31523
STAT time 1317992962
STAT version 1.4.5
STAT pointer_size 64
STAT rusage_user 0.000000
STAT rusage_system 0.000000
STAT curr_connections 10
STAT total_connections 41
STAT connection_structures 11
STAT cmd_get 0
STAT cmd_set 0
STAT cmd_flush 0
STAT get_hits 0
STAT get_misses 0
STAT delete_misses 0
STAT delete_hits 0
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 190
STAT bytes_written 23756
STAT limit_maxbytes 67108864
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT bytes 0
STAT curr_items 0
STAT total_items 0
STAT evictions 0
STAT reclaimed 0
END
As you can see the cmd_get value is 0 in telnet stats. Can anybody
please advice?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com.
To unsubscribe from this group, send email to django-users+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Tom Evans
2011-10-07 14:13:56 UTC
Permalink
Post by TINO THOMAS
Thank you Henrik for your help.
I have already given the following entry in settings.py for python-memcached
binding
CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION': '127.0.0.1:11211',
    }
}
What should i do next , if i want to get a pers-site cache? . Sorry i am a
newbie in this.
Have you told Django to cache using a per-site cache, as explicitly
described in the documentation?

https://docs.djangoproject.com/en/1.3/topics/cache/#the-per-site-cache

Cheers

Tom
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com.
To unsubscribe from this group, send email to django-users+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
TINO THOMAS
2011-10-07 15:09:34 UTC
Permalink
Thank you Tom, I have set my settings.py appropriately and now caching is
working fine.
Post by Henrik Genssen
Post by TINO THOMAS
Thank you Henrik for your help.
I have already given the following entry in settings.py for
python-memcached
Post by TINO THOMAS
binding
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
What should i do next , if i want to get a pers-site cache? . Sorry i am
a
Post by TINO THOMAS
newbie in this.
Have you told Django to cache using a per-site cache, as explicitly
described in the documentation?
https://docs.djangoproject.com/en/1.3/topics/cache/#the-per-site-cache
Cheers
Tom
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com.
To unsubscribe from this group, send email to django-users+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Brett Epps
2011-10-07 15:40:13 UTC
Permalink
Have you configured Django to use memcached in your CACHES setting? If
so, can you post that? Also, what are you caching?

Brett
Post by tino
Hello,
I am trying to implement memcached on my django site.
# telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
stats
STAT pid 22537
STAT uptime 31523
STAT time 1317992962
STAT version 1.4.5
STAT pointer_size 64
STAT rusage_user 0.000000
STAT rusage_system 0.000000
STAT curr_connections 10
STAT total_connections 41
STAT connection_structures 11
STAT cmd_get 0
STAT cmd_set 0
STAT cmd_flush 0
STAT get_hits 0
STAT get_misses 0
STAT delete_misses 0
STAT delete_hits 0
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 190
STAT bytes_written 23756
STAT limit_maxbytes 67108864
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT bytes 0
STAT curr_items 0
STAT total_items 0
STAT evictions 0
STAT reclaimed 0
END
As you can see the cmd_get value is 0 in telnet stats. Can anybody
please advice?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com.
To unsubscribe from this group, send email to django-users+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Brett Epps
2011-10-07 15:45:16 UTC
Permalink
Disregard my reply, I see that you solved your problem already. (I missed
the rest of the thread until now.)

Brett
Post by Brett Epps
Have you configured Django to use memcached in your CACHES setting? If
so, can you post that? Also, what are you caching?
Brett
Post by tino
Hello,
I am trying to implement memcached on my django site.
# telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
stats
STAT pid 22537
STAT uptime 31523
STAT time 1317992962
STAT version 1.4.5
STAT pointer_size 64
STAT rusage_user 0.000000
STAT rusage_system 0.000000
STAT curr_connections 10
STAT total_connections 41
STAT connection_structures 11
STAT cmd_get 0
STAT cmd_set 0
STAT cmd_flush 0
STAT get_hits 0
STAT get_misses 0
STAT delete_misses 0
STAT delete_hits 0
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 190
STAT bytes_written 23756
STAT limit_maxbytes 67108864
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT bytes 0
STAT curr_items 0
STAT total_items 0
STAT evictions 0
STAT reclaimed 0
END
As you can see the cmd_get value is 0 in telnet stats. Can anybody
please advice?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com.
To unsubscribe from this group, send email to django-users+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Continue reading on narkive:
Loading...