Reset cache related settings for MDN on prod/stage/develop

RESOLVED FIXED

Status

--
major
RESOLVED FIXED
4 years ago
3 months ago

People

(Reporter: jezdez, Assigned: cturra)

Tracking

Details

(Reporter)

Description

4 years ago
As part of the just merged pull request https://github.com/mozilla/kuma/pull/2423
we're reintroducing an optional Django cache backend using Memcache.

Once you've done that, we need to do a deploy right away to make sure the newly added cache is used. Please schedule time with :groovecoder or me about that.

Please make sure there is *no* active setting called CACHE_BACKEND.
We need to update the cache related setting to the following values.

On the web heads:

    # Cache Settings
    CACHE_PREFIX = 'kuma'
    CACHE_COUNT_TIMEOUT = 60  # in seconds

    CACHES = {
        'default': {
            'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
            'TIMEOUT': CACHE_COUNT_TIMEOUT,
            'KEY_PREFIX': CACHE_PREFIX,
        },
        'secondary': {
            'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
            'TIMEOUT': CACHE_COUNT_TIMEOUT,
            'KEY_PREFIX': CACHE_PREFIX,
        },
        'memcache': {
            'BACKEND': 'memcached_hashring.backend.MemcachedHashRingCache',
            'TIMEOUT': CACHE_COUNT_TIMEOUT * 60 * 24,
            'KEY_PREFIX': CACHE_PREFIX,
            'LOCATION': [
                '10.22.81.21',
                '10.22.81.22'
            ],
        },
    }

On stage and dev we don't need *any* cache related settings, we can use the
ones declared in the parent settings.py file. Please delete the settings:

- CACHE_BACKEND
- CACHES
(Assignee)

Comment 1

4 years ago
(In reply to Jannis Leidel [:jezdez] from comment #0)
> On stage and dev we don't need *any* cache related settings, we can use the
> ones declared in the parent settings.py file. Please delete the settings:
> 
> - CACHE_BACKEND
> - CACHES

up first i confirmed that there is already no CACHE_BACKEND or CACHES settings for both dev/stage.

moving forward with this in production, i just want to clarify the steps. it sounds like you want us to update the cache settings per your details above, then do a deploy with the latest code. can you please confirm that aligns with your expectations?
Assignee: server-ops-webops → cturra
Flags: needinfo?(jezdez)
(Reporter)

Comment 2

4 years ago
Exactly, when I checked the prod settings they seemed to already have the two cache backends "default" and "secondary" set up like above. So adding a third called "memcache" won't have an impact on the currently running app. Only once we do the deployment of the latest code, we'll see that backend starting to be used.
Flags: needinfo?(jezdez)
(Assignee)

Comment 3

4 years ago
as discussed on irc, i have updated the prod settings file with these new cache settings. you should be able to push any code changed with chief.

\o/
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED

Updated

3 months ago
Product: Infrastructure & Operations → Infrastructure & Operations Graveyard
You need to log in before you can comment on or make changes to this bug.