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. 

Note

You must update the Redis settings when scaling the node.

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

  1. 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.
  2. In the YAML file, update the MaxClients field to the maximum number of clients connecting to the Redis instance. For example, enter 3000.
  3. 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 YAML
    LogLevel: 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
  4. 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.
  5. 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*