Updating the configuration settings for the Redis database
Redis is a high-performance in-memory data structure store used as a cache or message broker. Modifying Redis configuration improves performance, scalability, and security. For example, increasing the MaxClients setting allows more clients to connect to the Redis instance while adjusting DatabaseConfigAdditionalParams optimizes memory usage and network traffic.
Use this procedure to update the configuration settings for the Redis database that Hedge Services uses.
To update the configuration settings for the Redis database
- From the Docker volume, navigate to the /var/lib/docker/volumes/edgex_edgex-init/_data/bootstrap-redis/res directory and open the YAML file.
For Docker-based node deployments, use the directory reference. For Kubernetes-based core deployments, locate the corresponding PVC on the NFS server. - In the YAML file, update the MaxClients field to the maximum number of clients connecting to the Redis instance. For example, enter 3000.
In the DatabaseConfigAdditionalParams section, add or modify configuration lines as needed. For example, enter the following lines:
- client-output-buffer-limit pubsub 2048mb 1000mb 90
- maxmemory 128mb
- maxmemory-policy allkeys-lfu
The following is an example of a YAML file:Example YAMLLogLevel: INFO
Database:
Host: localhost
Name: "" # Unused
Password: "" # Will be set from the value in Vault
Username: "" # Will be set from the value in Vault
Port: 6379
Timeout: "5s"
Type: redisdb
DatabaseConfig:
Path: /path/to/redis/conf/dir
Name: redis.conf
MaxClients: 3000
DatabaseConfigAdditionalParams:
- client-output-buffer-limit pubsub 2048mb 1000mb 90
- maxmemory 128mb
- maxmemory-policy allkeys-lfu- Restart the edgex-redis service to apply the changes.
The system displays the updated Redis configuration generated conf file in the /var/lib/docker/volumes/edgex_redis-config/_data directory. - Check the Redis.conf file to verify that the modifications you made have been applied correctly.
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*