[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-25。"],[],[],null,["# Enabling a Redis cache on a customer-hosted instance\n\nLooker maintains a [cache](/looker/docs/caching-and-datagroups#how_looker_uses_cached_queries) as part of each instance. Looker's default cache is a custom caching solution that is based on several layers: in-memory, local disk, and remote disk. The Looker internal database is used as an index that identifies where cached objects are located in the system.\n\nIf you are hosting your own Looker instance, you can optionally configure Looker to use a separately hosted [Redis](https://redis.io/) cache. A Redis cache can provide the following benefits:\n\n- **Improved cache retrieval** --- The primary improvement will be in consistent cache-retrieval times. As the number of nodes in a Looker cluster increases, the inter-node communication can degrade cache performance. The new Redis cache architecture consolidates the cache, which results in consistent cache-retrieval times no matter the size of your Looker cluster.\n- **Less load** --- Additionally, the cache is in a separate tier from your Looker instance, which leads to less load on the Looker instance.\n- **Scalability** --- Use of a Redis cache also allows the cache to scale independently of your Looker instance.\n\nRequirements\n------------\n\nLooker supports Redis versions 4.0.x, 5.0.x, and 7.2.x. To use a Redis cache with Looker, your Redis instance must meet the following requirements:\n\n- The Redis instance must be accessible from the Looker instance.\n- The Redis instance must not be a cluster. However, you can use a replica instance for high availability.\n- The size of the Redis cache should be approximately equal to the size of your Looker cache. By default, the Looker cache is 2 GB per node; so, if you have a three-node Looker cluster, a 6 GB Redis cache is recommended.\n- The Redis `maxmemory-policy` configuration should be set to `volatile-lru`.\n- You will need to disable any Redis authentication. All data stored in Redis is encrypted in the Looker instance before being sent to the Redis server.\n- You can use a Redis option that is hosted on an AWS ElastiCache or a Google Memorystore, as long as it's not a Redis cluster configuration.\n\nIn addition, Looker's [GCM encryption](/looker/docs/migrating-to-aes-256-gcm-encryption) system is required to use Redis in Looker. You must update encryption for instances that use legacy encryption prior to enabling Redis. If you attempt to enable Redis without GCM encryption, Looker will fail to start with an error message similar to the following: \n\n 2020-01-23 10:28:44.253 -0800 [ERROR|007e4|cache] :: Must enable GCM encryption to use Redis caching\n\nFor instructions on upgrading from legacy encryption to GCM encryption, see the [Migrating to AES-256 GCM encryption](/looker/docs/migrating-to-aes-256-gcm-encryption) documentation page.\n\nSetting an environment variable to enable the Redis cache\n---------------------------------------------------------\n\nTo enable the Redis cache, you must set the `LOOKER_REDIS_CACHE_DISCOVERY` environment variable to point to the Redis connection URL and then do a complete restart of your Looker instance, including all nodes in the cluster. We recommend that you shut your server down completely, modify your environment and startup scripts as needed to include the environment variable, and then start all the nodes.\n\nTo shut down Looker, run the following commands on each node: \n\n cd looker\n ./looker stop\n\nThen, for example, if you have a local Redis instance on the same host at the default port, set the `LOOKER_REDIS_CACHE_DISCOVERY` environment variable as follows: \n\n export LOOKER_REDIS_CACHE_DISCOVERY=redis://localhost:6379\n\nThen restart Looker: \n\n ./looker start\n\nVerifying that the Redis cache is enabled\n-----------------------------------------\n\nTo determine if your Redis cache is enabled, look for entries in your [Looker log](/looker/docs/admin-panel-server-log). There should be log entries similar to the following: \n\n 2021-06-11 16:54:41.532 +0000 [INFO|007e4|RedissonClientPool] :: Creating client for redis://localhost:6379/\n ...\n 2021-06-11 16:54:42.802 +0000 [INFO|007e4|cache] :: Creating render_cache DataShelf: redis"]]