google-code-export / yabi

Automatically exported from code.google.com/p/yabi
0 stars 1 forks source link

Change code to use Django 1.3 Caching framework instead of using Memcache directly #179

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Change code to use Django 1.3 Caching framework instead of using Memcache 
directly in Yabife and Yabiadmin.

Original issue reported on code.google.com by szab...@gmail.com on 22 Mar 2012 at 5:05

GoogleCodeExporter commented 9 years ago
Consuming #102 

Original comment by aahun...@gmail.com on 22 Mar 2012 at 5:11

GoogleCodeExporter commented 9 years ago
Issue 102 has been merged into this issue.

Original comment by amacgregor on 22 Mar 2012 at 5:11

GoogleCodeExporter commented 9 years ago
Also from 102: Also, ensure that the Frontend is using Memcache session backend.

Original comment by amacgregor on 23 Mar 2012 at 7:01

GoogleCodeExporter commented 9 years ago
The following settings changes are required in Yabife and Yabiadmin.
(The examples below use appsettings/dev as an example)

Yabife settings changes:

Remove:

MEMCACHE_SERVERS = ['memcache1.localdomain:11211','memcache2.localdomain:11211']
MEMCACHE_KEYSPACE = "yabife-dev"

Instead add:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION': ['memcache1.localdomain:11211','memcache2.localdomain:11211'],
        'KEYSPACE': 'yabife-dev'
    }
}

Yabiadmin settings changes:

Remove the lines:

# memcache server list
MEMCACHE_SERVERS = ['memcache1.localdomain:11211','memcache2.localdomain:11211']
MEMCACHE_KEYSPACE = "yabiadmin-dev"

CACHE_BACKEND = 'memcached://'+(';'.join(MEMCACHE_SERVERS))+"/"

Add instead:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION': ['memcache1.localdomain:11211','memcache2.localdomain:11211'],
        'KEYSPACE': "yabiadmin-dev"
    }
}

Original comment by szab...@gmail.com on 2 Apr 2012 at 2:36

GoogleCodeExporter commented 9 years ago
Implemented, final commit: 1424e29639bb

Original comment by szab...@gmail.com on 2 Apr 2012 at 6:34

GoogleCodeExporter commented 9 years ago
Did some further work on this to ensure that keys did not contain spaces. The 
tool caching was just using the toolname, which could contain spaces. This 
would lead to issues with memcache failures, which in turn would lead 
python-memcache to mark servers as dead, which in turn would cause session 
problems.

Now fixed.

Original comment by amacgregor on 30 Apr 2012 at 7:55