Skip to content

Commit

Permalink
chore: update pymemcache settings (#33019)
Browse files Browse the repository at this point in the history
  • Loading branch information
mumarkhan999 committed Aug 16, 2023
1 parent 43315cb commit 07fbf3b
Show file tree
Hide file tree
Showing 10 changed files with 266 additions and 0 deletions.
25 changes: 25 additions & 0 deletions cms/envs/bok_choy.env.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"CACHES": {
"celery": {
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"OPTIONS": {
"no_delay": true,
"ignore_exc": true,
"use_pooling": true
},
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_celery",
"LOCATION": [
Expand All @@ -12,6 +17,11 @@
},
"default": {
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"OPTIONS": {
"no_delay": true,
"ignore_exc": true,
"use_pooling": true
},
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "sandbox_default",
"LOCATION": [
Expand All @@ -20,6 +30,11 @@
},
"general": {
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"OPTIONS": {
"no_delay": true,
"ignore_exc": true,
"use_pooling": true
},
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "sandbox_general",
"LOCATION": [
Expand All @@ -28,6 +43,11 @@
},
"mongo_metadata_inheritance": {
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"OPTIONS": {
"no_delay": true,
"ignore_exc": true,
"use_pooling": true
},
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_mongo_metadata_inheritance",
"LOCATION": [
Expand All @@ -36,6 +56,11 @@
},
"staticfiles": {
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"OPTIONS": {
"no_delay": true,
"ignore_exc": true,
"use_pooling": true
},
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_static_files",
"LOCATION": [
Expand Down
20 changes: 20 additions & 0 deletions cms/envs/bok_choy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,46 @@ BULK_EMAIL_DEFAULT_FROM_EMAIL: [email protected]
CACHES:
celery:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
ignore_exc: true
no_delay: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_celery
LOCATION: ['localhost:11211']
default:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
ignore_exc: true
no_delay: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_default
LOCATION: ['localhost:11211']
general:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
ignore_exc: true
no_delay: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_general
LOCATION: ['localhost:11211']
mongo_metadata_inheritance:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
ignore_exc: true
no_delay: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_mongo_metadata_inheritance
LOCATION: ['localhost:11211']
staticfiles:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
ignore_exc: true
no_delay: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_static_files
LOCATION: ['localhost:11211']
Expand Down
25 changes: 25 additions & 0 deletions cms/envs/bok_choy_docker.env.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"CACHES": {
"celery": {
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"OPTIONS": {
"no_delay": true,
"ignore_exc": true,
"use_pooling": true
},
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_celery",
"LOCATION": [
Expand All @@ -12,6 +17,11 @@
},
"default": {
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"OPTIONS": {
"no_delay": true,
"ignore_exc": true,
"use_pooling": true
},
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "sandbox_default",
"LOCATION": [
Expand All @@ -20,6 +30,11 @@
},
"general": {
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"OPTIONS": {
"no_delay": true,
"ignore_exc": true,
"use_pooling": true
},
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "sandbox_general",
"LOCATION": [
Expand All @@ -28,6 +43,11 @@
},
"mongo_metadata_inheritance": {
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"OPTIONS": {
"no_delay": true,
"ignore_exc": true,
"use_pooling": true
},
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_mongo_metadata_inheritance",
"LOCATION": [
Expand All @@ -36,6 +56,11 @@
},
"staticfiles": {
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"OPTIONS": {
"no_delay": true,
"ignore_exc": true,
"use_pooling": true
},
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_static_files",
"LOCATION": [
Expand Down
20 changes: 20 additions & 0 deletions cms/envs/bok_choy_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,46 @@ BULK_EMAIL_DEFAULT_FROM_EMAIL: [email protected]
CACHES:
celery:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
no_delay: true
ignore_exc: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_celery
LOCATION: ['edx.devstack.memcached:11211']
default:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
no_delay: true
ignore_exc: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_default
LOCATION: ['edx.devstack.memcached:11211']
general:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
no_delay: true
ignore_exc: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_general
LOCATION: ['edx.devstack.memcached:11211']
mongo_metadata_inheritance:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
no_delay: true
ignore_exc: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_mongo_metadata_inheritance
LOCATION: ['edx.devstack.memcached:11211']
staticfiles:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
no_delay: true
ignore_exc: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_static_files
LOCATION: ['edx.devstack.memcached:11211']
Expand Down
40 changes: 40 additions & 0 deletions cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2171,52 +2171,92 @@
'LOCATION': ['localhost:11211'],
'TIMEOUT': '86400', # This data should be long-lived for performance, BundleCache handles invalidation
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
'OPTIONS': {
'no_delay': True,
'ignore_exc': True,
'use_pooling': True,
}
},
'course_structure_cache': {
'KEY_PREFIX': 'course_structure',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'TIMEOUT': '7200',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
'OPTIONS': {
'no_delay': True,
'ignore_exc': True,
'use_pooling': True,
}
},
'celery': {
'KEY_PREFIX': 'celery',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'TIMEOUT': '7200',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
'OPTIONS': {
'no_delay': True,
'ignore_exc': True,
'use_pooling': True,
}
},
'mongo_metadata_inheritance': {
'KEY_PREFIX': 'mongo_metadata_inheritance',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'TIMEOUT': 300,
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
'OPTIONS': {
'no_delay': True,
'ignore_exc': True,
'use_pooling': True,
}
},
'staticfiles': {
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'staticfiles_general',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
'OPTIONS': {
'no_delay': True,
'ignore_exc': True,
'use_pooling': True,
}
},
'default': {
'VERSION': '1',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'default',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
'OPTIONS': {
'no_delay': True,
'ignore_exc': True,
'use_pooling': True,
}
},
'configuration': {
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'configuration',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
'OPTIONS': {
'no_delay': True,
'ignore_exc': True,
'use_pooling': True,
}
},
'general': {
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'general',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
'OPTIONS': {
'no_delay': True,
'ignore_exc': True,
'use_pooling': True,
}
},
}

Expand Down
28 changes: 28 additions & 0 deletions cms/envs/devstack-experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,46 +54,74 @@ BULK_EMAIL_LOG_SENT_EMAILS: false
CACHES:
celery:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
no_delay: true
ignore_exc: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: celery
LOCATION:
- edx.devstack.memcached:11211
TIMEOUT: '7200'
configuration:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
no_delay: true
ignore_exc: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: 78f87108afce
LOCATION:
- edx.devstack.memcached:11211
course_structure_cache:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
no_delay: true
ignore_exc: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: course_structure
LOCATION:
- edx.devstack.memcached:11211
TIMEOUT: '7200'
default:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
ignore_exc: true
no_delay: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: default
LOCATION:
- edx.devstack.memcached:11211
VERSION: '1'
general:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
no_delay: true
ignore_exc: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: general
LOCATION:
- edx.devstack.memcached:11211
mongo_metadata_inheritance:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
no_delay: true
ignore_exc: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: mongo_metadata_inheritance
LOCATION:
- edx.devstack.memcached:11211
TIMEOUT: 300
staticfiles:
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
OPTIONS:
no_delay: true
ignore_exc: true
use_pooling: true
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: 78f87108afce_general
LOCATION:
Expand Down
Loading

0 comments on commit 07fbf3b

Please sign in to comment.