Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Superset caching not working for metadata #31615

Open
3 tasks done
nikhilkudavemnh opened this issue Dec 25, 2024 · 1 comment
Open
3 tasks done

Superset caching not working for metadata #31615

nikhilkudavemnh opened this issue Dec 25, 2024 · 1 comment
Labels
infra:caching Infra setup and configuration related to caching

Comments

@nikhilkudavemnh
Copy link

Bug description

this is the superset_config file I used caching on Redis and celery but it still wont work.

http://domain.com/genreateguest token------------------------------------takes 2 sec
https://domain.com/embedded/3d0346ae-8dc0-4776-bf02-d87692a918f1uiConfig=10&show_filters=false&expand_filters=false----------this takes 3sec
https://domain.com/api/v1/dashboard/5/datasets---------------------------this takes 2 sec

ROW_LIMIT = 10000
SECRET_KEY = SUPERSET_SECRET_KEY

FEATURE FlAGS
FEATURE_FLAGS = {
"EMBEDDED_SUPERSET": True,
"TAGGING_SYSTEM": False,
"ENABLE_TEMPLATE_PROCESSING": True,
"HORIZONTAL_FILTER_BAR":True,
"FAB_ADD_SECURITY_API": True,
"DASHBOARD_RBAC":True,
"ALLOW_FULL_CSV_EXPORT":True,
"DRILL_TO_DETAIL":True,
"DASHBOARD_VIRTUALIZATION":False,
"SQL_VALIDATORS_BY_ENGINE": {
'postgresql': 'PostgresSQLValidator'
}
}

class CeleryConfig(object):
broker_url = "redis://localhost:6379/0"
imports = (
"superset.sql_lab",
"superset.tasks.scheduler",
)
result_backend = "redis://localhost:6379/0"
worker_prefetch_multiplier = 10
task_acks_late = True
task_annotations = {
"sql_lab.get_sql_results": {
"rate_limit": "100/s",
},
}

from flask_caching.backends.rediscache import RedisCache

RESULTS_BACKEND = RedisCache(
host='localhost', port=6379, key_prefix='superset_results')

FILTER_STATE_CACHE_CONFIG = {
'CACHE_TYPE': 'RedisCache',
'CACHE_DEFAULT_TIMEOUT': 86400,
'CACHE_KEY_PREFIX': 'superset_filter_cache',
'CACHE_REDIS_URL': 'redis://localhost:6379/0'
}

DATA_CACHE_CONFIG = {
"CACHE_TYPE": "SupersetMetastoreCache",
"CACHE_KEY_PREFIX": "superset_results",
"CACHE_DEFAULT_TIMEOUT": 86400,
}

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.10

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@dosubot dosubot bot added the infra:caching Infra setup and configuration related to caching label Dec 25, 2024
Copy link

dosubot bot commented Dec 25, 2024

I found a couple of similar discussions that might be relevant to your issue:

  1. Redis CROSSSLOT keys request don't hash to the same slot - This discussion is still open and might provide insights into Redis configuration issues [1].

  2. Understanding how caching helps in auto-refreshing dashboards - This is another open discussion that could offer some understanding of caching mechanisms in Superset [2].

Regarding your configuration, here are a few things to consider:

  1. Redis Configuration: Ensure that your Redis server is running and accessible at the specified host and port. You can test connectivity using a Redis client.

  2. Cache Configuration: Your DATA_CACHE_CONFIG is set to use SupersetMetastoreCache, which is different from Redis. If you intend to use Redis for all caching, you might want to align this configuration with your FILTER_STATE_CACHE_CONFIG by using RedisCache instead.

  3. Celery and Redis: Ensure that both Celery and Redis are properly configured and running. Check the logs for any errors related to task execution or result storage.

  4. Cache Key Prefixes: Make sure that the CACHE_KEY_PREFIX values are unique and correctly set to avoid any key collisions.

  5. Superset Logs: Review the Superset logs for any error messages or warnings that might indicate what is going wrong with the caching mechanism.

If these steps do not resolve the issue, you might want to explore the discussions mentioned above for additional insights or consider testing with a simplified configuration to isolate the problem.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra:caching Infra setup and configuration related to caching
Projects
None yet
Development

No branches or pull requests

1 participant