Add memcached

Seahub caches items (avatars, profiles, etc) on the file system in /tmp/seahub_cache/ by default. You can replace it with Memcached.

First, you should make sure libmemcached library and development headers are installed in your system. Version 1.0.18 of libmemcached or later should be used.

On Ubuntu 16.04 or similar, the version in system repository is new enough. So you can install it directly.

sudo apt-get install libmemcached-dev

On other systems, such as CentOS 7 or Ubuntu 14.04, you should install the library from source code.

sudo apt-get install build-essential # or sudo yum install gcc gcc-c++ make openssl-devel
tar zxf libmemcached
cd libmemcached-1.0.18
sudo make install

Install Python memcache library.

sudo pip install pylibmc
sudo pip install django-pylibmc

Add the following configuration to

    'default': {
        'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
        'LOCATION': '',

If you use memcached cluster, please replace the CACHES variable with the following. This configuration uses consistent hashing to distribute the keys in memcached. More information can be found on pylibmc documentation and django-pylibmc documentation. Supposed your memcached server addresses are[4-6].

    'default': {
        'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
        'LOCATION': ['', '', '',],
        'OPTIONS': {
            'ketama': True,
            'remove_failed': 1,
            'retry_timeout': 3600,
            'dead_timeout': 3600

results matching ""

    No results matching ""