chore: replace memcachecache with pymemcache backend (#32845)

This commit is contained in:
Muhammad Umar Khan
2023-07-26 16:50:39 +05:00
committed by GitHub
parent f4616f02c8
commit 23d696675f
10 changed files with 60 additions and 64 deletions

View File

@@ -3,7 +3,7 @@
"BULK_EMAIL_DEFAULT_FROM_EMAIL": "no-reply@example.com",
"CACHES": {
"celery": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_celery",
"LOCATION": [
@@ -11,7 +11,7 @@
]
},
"default": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "sandbox_default",
"LOCATION": [
@@ -19,7 +19,7 @@
]
},
"general": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "sandbox_general",
"LOCATION": [
@@ -27,7 +27,7 @@
]
},
"mongo_metadata_inheritance": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_mongo_metadata_inheritance",
"LOCATION": [
@@ -35,7 +35,7 @@
]
},
"staticfiles": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_static_files",
"LOCATION": [

View File

@@ -6,27 +6,27 @@ BUGS_EMAIL: bugs@example.com
BULK_EMAIL_DEFAULT_FROM_EMAIL: no-reply@example.com
CACHES:
celery:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_celery
LOCATION: ['localhost:11211']
default:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_default
LOCATION: ['localhost:11211']
general:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_general
LOCATION: ['localhost:11211']
mongo_metadata_inheritance:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_mongo_metadata_inheritance
LOCATION: ['localhost:11211']
staticfiles:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_static_files
LOCATION: ['localhost:11211']
@@ -128,4 +128,3 @@ XQUEUE_INTERFACE:
url: http://localhost:18040
ZENDESK_API_KEY: ''
ZENDESK_USER: ''

View File

@@ -3,7 +3,7 @@
"BULK_EMAIL_DEFAULT_FROM_EMAIL": "no-reply@example.com",
"CACHES": {
"celery": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_celery",
"LOCATION": [
@@ -11,7 +11,7 @@
]
},
"default": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "sandbox_default",
"LOCATION": [
@@ -19,7 +19,7 @@
]
},
"general": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "sandbox_general",
"LOCATION": [
@@ -27,7 +27,7 @@
]
},
"mongo_metadata_inheritance": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_mongo_metadata_inheritance",
"LOCATION": [
@@ -35,7 +35,7 @@
]
},
"staticfiles": {
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"KEY_FUNCTION": "common.djangoapps.util.memcache.safe_key",
"KEY_PREFIX": "integration_static_files",
"LOCATION": [

View File

@@ -6,27 +6,27 @@ BUGS_EMAIL: bugs@example.com
BULK_EMAIL_DEFAULT_FROM_EMAIL: no-reply@example.com
CACHES:
celery:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_celery
LOCATION: ['edx.devstack.memcached:11211']
default:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_default
LOCATION: ['edx.devstack.memcached:11211']
general:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
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.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
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.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_static_files
LOCATION: ['edx.devstack.memcached:11211']
@@ -125,4 +125,3 @@ XQUEUE_INTERFACE:
url: http://localhost:18040
ZENDESK_API_KEY: ''
ZENDESK_USER: ''

View File

@@ -2171,53 +2171,53 @@ CACHES = {
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'TIMEOUT': '86400', # This data should be long-lived for performance, BundleCache handles invalidation
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
},
'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.MemcachedCache',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
},
'celery': {
'KEY_PREFIX': 'celery',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'TIMEOUT': '7200',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
},
'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.MemcachedCache',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
},
'staticfiles': {
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'staticfiles_general',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
},
'default': {
'VERSION': '1',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'default',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
},
'configuration': {
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'configuration',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
},
'general': {
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'general',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
},
}

View File

@@ -53,47 +53,47 @@ BULK_EMAIL_EMAILS_PER_TASK: 500
BULK_EMAIL_LOG_SENT_EMAILS: false
CACHES:
celery:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
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.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
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.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
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.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
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.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
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.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
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.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: 78f87108afce_general
LOCATION:

View File

@@ -19,27 +19,27 @@ BLOCK_STRUCTURES_SETTINGS:
CACHES:
celery:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_celery
LOCATION: ['localhost:11211']
default:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_default
LOCATION: ['localhost:11211']
general:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_general
LOCATION: ['localhost:11211']
mongo_metadata_inheritance:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_mongo_metadata_inheritance
LOCATION: ['localhost:11211']
staticfiles:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_static_files
LOCATION: ['localhost:11211']
@@ -252,4 +252,3 @@ XQUEUE_INTERFACE:
ZENDESK_API_KEY: ''
ZENDESK_USER: ''

View File

@@ -8,27 +8,27 @@ BUGS_EMAIL: bugs@example.com
BULK_EMAIL_DEFAULT_FROM_EMAIL: no-reply@example.com
CACHES:
celery:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_celery
LOCATION: ['edx.devstack.memcached:11211']
default:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_default
LOCATION: ['edx.devstack.memcached:11211']
general:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
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.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
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.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_static_files
LOCATION: ['edx.devstack.memcached:11211']
@@ -161,4 +161,3 @@ XQUEUE_INTERFACE:
url: '** OVERRIDDEN **'
ZENDESK_API_KEY: ''
ZENDESK_USER: ''

View File

@@ -1113,53 +1113,53 @@ CACHES = {
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'TIMEOUT': '86400', # This data should be long-lived for performance, BundleCache handles invalidation
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
},
'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.MemcachedCache',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
},
'celery': {
'KEY_PREFIX': 'celery',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'TIMEOUT': '7200',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
},
'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.MemcachedCache',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
},
'staticfiles': {
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'staticfiles_general',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
},
'default': {
'VERSION': '1',
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'default',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
},
'configuration': {
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'configuration',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
},
'general': {
'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'general',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
},
}

View File

@@ -72,47 +72,47 @@ BULK_EMAIL_LOG_SENT_EMAILS: false
BULK_EMAIL_ROUTING_KEY_SMALL_JOBS: edx.lms.core.default
CACHES:
celery:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
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.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
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.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
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.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
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.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
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.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
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.MemcachedCache
BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: 78f87108afce_general
LOCATION: