可能是我对 django 缓存的期望过高,但以防万一我在这里遗漏了一些东西。
我已经安装了 memcached(memcached、libmemcached 和 python-memcached)并按照此指令对其进行了配置。
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
所以我启动了 memcached 并重新启动了应用程序服务器,但 django 似乎没有使用 memcached。
stats (over 11211 port)
STAT pid 30582
STAT uptime 6574
STAT time 1331463502
STAT version 1.4.13
STAT libevent 2.0.17-stable
STAT pointer_size 32
STAT rusage_user 0.000000
STAT rusage_system 0.180011
STAT curr_connections 5
STAT total_connections 11
STAT connection_structures 6
STAT reserved_fds 20
STAT cmd_get 0
STAT cmd_set 0
STAT cmd_flush 0
STAT cmd_touch 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 touch_hits 0
STAT touch_misses 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 81
STAT bytes_written 5172
STAT limit_maxbytes 16777216
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT hash_power_level 16
STAT hash_bytes 262144
STAT hash_is_expanding 0
STAT expired_unfetched 0
STAT evicted_unfetched 0
STAT bytes 0
STAT curr_items 0
STAT total_items 0
STAT evictions 0
STAT reclaimed 0
END