How to Verify if SQL Lab is Using Redis Cache in Apache Superset (Docker Setup)? #31298
Replies: 2 comments
-
To verify if SQL Lab is using Redis for caching queries in your Apache Superset Docker setup, you can check the Here's a breakdown of your configuration:
To ensure that SQL Lab is effectively using Redis for caching, you can:
These steps will help you confirm that SQL Lab is utilizing Redis for caching queries in your setup [1][2]. |
Beta Was this translation helpful? Give feedback.
-
Hm can you configure the Redis cache to cache queries performed in SQL Lab? I have not tried to do that. But regardless, here is how I confirmed that caching was working for other operations (e.g., loading a chart a second time):
The second and third bullets can be done directly in Redis. If folks try this, feel free to reply with what worked. Possibly useful links on cache config: |
Beta Was this translation helpful? Give feedback.
-
I am running Apache Superset in a Docker environment and have configured Redis as the cache backend. I want to verify if SQL Lab is effectively using Redis for caching queries.
configurations i have used.
REDIS_HOST = os.getenv("REDIS_HOST", "redis")
REDIS_PORT = os.getenv("REDIS_PORT", "6379")
REDIS_CELERY_DB = os.getenv("REDIS_CELERY_DB", "0")
REDIS_RESULTS_DB = os.getenv("REDIS_RESULTS_DB", "1")
RESULTS_BACKEND = FileSystemCache("/app/superset_home/sqllab")
CACHE_CONFIG = {
"CACHE_TYPE": "RedisCache",
"CACHE_DEFAULT_TIMEOUT": 300,
"CACHE_KEY_PREFIX": "superset_",
"CACHE_REDIS_HOST": REDIS_HOST,
"CACHE_REDIS_PORT": REDIS_PORT,
"CACHE_REDIS_DB": REDIS_RESULTS_DB,
}
DATA_CACHE_CONFIG = CACHE_CONFIG
QUERY_SEARCH_CACHE_CONFIG = {
'CACHE_TYPE': 'RedisCache',
'CACHE_DEFAULT_TIMEOUT': 5000, # 5 minutes
'CACHE_KEY_PREFIX': 'superset_query_cache_',
'CACHE_REDIS_HOST': REDIS_HOST,
'CACHE_REDIS_PORT': 6379,
"CACHE_REDIS_DB": REDIS_RESULTS_DB,
'CACHE_REDIS_URL': 'redis://superset-redis-master:6379'
}
class CeleryConfig:
broker_url = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_CELERY_DB}"
imports = (
"superset.sql_lab",
"superset.tasks.scheduler",
"superset.tasks.thumbnails",
"superset.tasks.cache",
)
result_backend = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_RESULTS_DB}"
worker_prefetch_multiplier = 10
task_acks_late = True
beat_schedule = {
"reports.scheduler": {
"task": "reports.scheduler",
"schedule": crontab(minute="", hour=""),
},
"reports.prune_log": {
"task": "reports.prune_log",
"schedule": crontab(minute=10, hour=0),
},
}
CELERY_CONFIG = CeleryConfig
Beta Was this translation helpful? Give feedback.
All reactions