dosubot[bot] commented on issue #29908: URL: https://github.com/apache/superset/issues/29908#issuecomment-2278650545
<!-- Answer --> To resolve the warning about using in-memory storage for tracking rate limits in Superset during startup, you need to configure a persistent storage backend for rate limiting. This can be done by setting the `RATELIMIT_STORAGE_URI` in your configuration file to a supported storage backend, such as Redis. Here is how you can set it up in your `superset_config.py`: ```python # A storage location conforming to the scheme in storage-scheme. See the limits # library for allowed values: https://limits.readthedocs.io/en/stable/storage.html RATELIMIT_STORAGE_URI = "redis://host:port" ``` Replace `"redis://host:port"` with the actual URI of your Redis instance. This will configure Superset to use Redis for tracking rate limits instead of the default in-memory storage. Additionally, you can refer to the `docker/pythonpath_dev/superset_config.py` for an example configuration that includes Redis settings: ```python import os 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") 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 class CeleryConfig: broker_url = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_CELERY_DB}" result_backend = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_RESULTS_DB}" CELERY_CONFIG = CeleryConfig ``` Ensure that your Redis instance is running and accessible at the specified host and port. This will help you avoid the in-memory storage warning and improve the reliability of rate limiting in Superset <sup>[[1]](https://github.com/apache/superset/blob/master/superset/config.py)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/docker/pythonpath_dev/superset_config.py)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
