Skip to main content

guillotina cache implementation using redis + lru in-memory cache

Project description

https://travis-ci.org/guillotinaweb/guillotina_rediscache.svg?branch=master

guillotina_rediscache implements redis into guillotina with an additional in-memory layer cache.

In order to coordinate invalidating the in-memory cache, guillotina_rediscache utilizes the pub/sub feature redis provides.

Configuration

app_settings for this:

{
  "databases": {
    "db": {
      ...
      "cache_strategy": "redis"
      ...
    }
  },
  "redis": {
      'host': 'localhost',
      'port': 6379,
      'ttl': 3600,
      'memory_cache_size': 209715200,
      'pool': {
          'minsize': 5,
          'maxsize': 100
      }
  }
}

Run measures

Using guillotina run command:

./bin/g run --script=measures/serialize.py -c measures/config.yaml

With profiling:

./bin/g run --script=measures/serialize.py -c measures/config.yaml --line-profiler --line-profiler-matcher="*serialize*"

2.1.0 (2018-11-20)

  • Upgrade to Guillotina >= 4.3 [bloodbare]

2.0.4 (2018-10-06)

  • Do not fail memory cache if not configured [vangheem]

2.0.3 (2018-07-20)

  • Remove old guillotina compatibility for py 3.7 [bloodbare]

2.0.2 (2018-06-18)

  • Improve size calculation [jordic]

2.0.1 (2018-06-15)

  • Change default cache size to 209715200 [vangheem]

2.0.0 (2018-06-15)

  • Cache based on memory size instead of total number of keys [jordic]

1.3.4 (2018-04-03)

  • Fix fixture [vangheem]

1.3.3 (2018-04-03)

  • Upgrade testing for guillotina 3.0 [vangheem]

1.3.2 (2018-03-26)

  • Use after commit hook to update data for file manager implementation [vangheem]

1.3.1 (2018-03-19)

  • Fix redis file manager finish method [vangheem]

1.3.0 (2018-03-19)

  • Provide redis file manager [vangheem]

1.2.0 (2018-03-14)

  • Upgrade to work with guillotina 2.4.x [vangheem]

1.1.6 (2018-03-01)

  • Handle errors while canceling task init task [vangheem]

1.1.5 (2018-03-01)

  • Handle errors while canceling task [vangheem]

1.1.4 (2018-02-15)

  • Fix cache stats endpoint [vangheem]

1.1.3 (2018-01-22)

  • Be able to disable deleting group of cache keys together with cluster_mode option. [vangheem]

1.1.2 (2018-01-17)

  • Fix using redis.delete when keys are of length 0 [vangheem]

1.1.1 (2018-01-17)

  • batch all cache deletes into one request [vangheem]

1.1.0 (2018-01-12)

  • Push cache updates to redis subscriber. This should improve cache hits dramatically [vangheem]

1.0.14 (2018-01-10)

  • Only run invalidation task if we have keys to invalidate [vangheem]

1.0.13 (2017-12-15)

  • Improve request performance [vangheem]

  • Change the way we’re using the redis pool so it reuses connections [vangheem]

1.0.12 (2017-11-30)

  • Missing await statement for self.get_redis() [vangheem]

1.0.11 (2017-11-08)

  • Handle CancelledError [vangheem]

1.0.10 (2017-11-06)

  • upgrade for guillotina 2.0.0 [vangheem]

1.0.9 (2017-10-23)

  • Fix handling connection objects and releasing back to pool [vangheem]

1.0.8 (2017-10-23)

  • Fix use of pool [vangheem]

1.0.7 (2017-10-23)

  • Use pickle instead of json from load/dumps because it is much faster [vangheem]

1.0.6 (2017-10-19)

  • Use ujson [vangheem]

1.0.5 (2017-10-02)

  • Track all keys needing invalidation and do invalidation in an async task so the request can finish faster. [vangheem]

1.0.4 (2017-05-29)

  • Test fixes [vangheem]

1.0.3 (2017-05-26)

  • Fix delete not properly invalidating cache [vangheem]

1.0.2 (2017-05-15)

  • Fix channel publishing invalidations [vangheem]

1.0.1 (2017-05-15)

  • Fix release

1.0.0 (2017-05-15)

  • initial release

Project details


Download files

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

Source Distribution

guillotina_rediscache-2.1.0.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

guillotina_rediscache-2.1.0-cp36-cp36m-macosx_10_13_x86_64.whl (30.0 kB view details)

Uploaded CPython 3.6m macOS 10.13+ x86-64

File details

Details for the file guillotina_rediscache-2.1.0.tar.gz.

File metadata

  • Download URL: guillotina_rediscache-2.1.0.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for guillotina_rediscache-2.1.0.tar.gz
Algorithm Hash digest
SHA256 8c83f81483427966321f77f18ce7d42614924c4ccedcc3641f660a3c6eca5228
MD5 f76ae773920a1c690b337aa5dcc005cf
BLAKE2b-256 b77771b0ea6e05e61dae11dfb7882795a3c4d9315832f26535bac57d9b16a77f

See more details on using hashes here.

File details

Details for the file guillotina_rediscache-2.1.0-cp36-cp36m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: guillotina_rediscache-2.1.0-cp36-cp36m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 30.0 kB
  • Tags: CPython 3.6m, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for guillotina_rediscache-2.1.0-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 ad30754bd574838f318767c8419dac3bbd430c7067a7020378776c3317c2c97e
MD5 e5334bc6205eff6408563ec062d435b9
BLAKE2b-256 129e164c52628b1d2d86e0183c9e89a4bdcb9e700bd9cf64d042e2f30b681e1e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page