Code Monkey home page Code Monkey logo

Comments (5)

armooo avatar armooo commented on July 22, 2024

I quickly tested this and switching the django cache backend "just works". Most of the work here will be packaging django_redis for debian and updating the puppet config. The dev vm will also need it added to the requirements.txt.

pip install django-redis

diff --git a/zproject/settings.py b/zproject/settings.py
index af6341d..aeeeac2 100644
--- a/zproject/settings.py
+++ b/zproject/settings.py
@@ -327,8 +327,8 @@ SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"

 CACHES = {
     'default': {
-        'BACKEND':  'django.core.cache.backends.memcached.PyLibMCCache',
-        'LOCATION': '127.0.0.1:11211',
+        'BACKEND':  'django_redis.cache.RedisCache',
+        'LOCATION': 'redis://127.0.0.1:6379/1',
         'TIMEOUT':  3600
     },
     'database': {

from zulip.

jros2300 avatar jros2300 commented on July 22, 2024

Zulip is using now Redis for the rate limit feature and memcached for the django backend. Do you think it worth consolidating both in a Redis cache, and reduce the number of processes? I can work in the pull request if the team thinks they can approve it.

from zulip.

timabbott avatar timabbott commented on July 22, 2024

I'd definitely be interested in a pull request that makes it possible to using redis for the cache; before we switch over I'd like to at least do some measurement of whether there's performance impact since we make extensive use of large multi-get queries (e.g. to fetch 1000 message objects from the cache; see the generic_bulk_cached_fetch in zerver/views/messages.py). A few other details that will need thought:

  • scripts/setup/flush-memcached
  • redis configuration to manage memory usage etc.

from zulip.

timabbott avatar timabbott commented on July 22, 2024

(In particular, I can imagine the Django Python library for redis having a perf issue impacting our usage and I think given an implementation I can fairly easy verify whether that's the case)

from zulip.

beenotung avatar beenotung commented on July 22, 2024

It seems both redis and memcached are in use currently (according to the docker-compose file in the docker-zulip project)

from zulip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.