Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A Memcached Pool for Django

Project Description

An efficient fast Django Memcached backend with a pool of connectors, based on pymemcache.


Each connection added in the pool stays connected to Memcache or Membase, drastically limiting the number of reconnections and open sockets your application will use on high load.

If you configure more than one Memcache server, each new connection will randomly pick one.

Everytime a socket timeout occurs on a server, it’s blacklisted so new connections avoid picking it for a while.

To use this backend, make sure the package is installed in your environment then use djmemcache.backend.PyMemcacheCache as backend in your settings.

Here’s an example:

    'default': {
        'BACKEND': 'djmemcache.backend.PyMemcacheCache',
        'LOCATION': '',
        'OPTIONS': {
                'MAX_POOL_SIZE': 100,
                'KEY_PREFIX': b'uuboard_prefix',
                'TIMEOUT': 30,
                'CONNECT_TIMEOUT': 30,


  • MAX_POOL_SIZE: – The maximum number of connectors in the pool for eatch host. default: 2 ** 31.
  • KEY_PREFIX – The time in seconds a server stays in the blacklist. default: b’‘
  • TIMEOUT – The time in seconds for the socket timeout. defaults to “forever”
  • CONNECT_TIMEOUT – The time in seconds for the connect socket timeout. defaults to “forever”
  • USE_POOLING – Whether to apply the connection pool. defaults to “False”

2015-04-30 - 0.1

  • Initial release
Release History

Release History

This version
History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
djmemcache-0.8-py3.4.egg (5.8 kB) Copy SHA256 Checksum SHA256 3.4 Egg Jul 27, 2015
djmemcache-0.8.tar.gz (3.2 kB) Copy SHA256 Checksum SHA256 Source Jul 27, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting