Redis Configuration

Redis can be configured to run in single mode or a cluster configuration.

This section offers suggestions on how to setup an ideal CSM environment, including high availability considerations that add resiliency to a Redis database.

Settings

Redis is a simple application that requires an executable to be present and running on a given machine. On the startup.exe, Redis reads a flat .config file that contains a number of value pairs to establish the different available settings. Some settings will be specific to your environment, but others directly impact CSM.

Common Settings

All Redis instances should be configured to NOT save any data to disk by commenting out the SAVE directive in the default config file. Commenting is done by adding a # in front of it. Use the password directive in the default file to set the password so communication with Redis only happens with processes that know the password.

Optional Settings

Depending on the environment, if you want to provide high availability, you need to configure sentinels, masters, and slaves. If the Redis memory demand exceeds what is provided on a single server, configure Redis with clustering. Using a cluster configuration provides three main benefits:
  • Shares large memory cache across many servers.
  • Provides high availability.
  • Distributes the CPU load across multiple CPUs (Redis is a single CPU process).

Connections

Run Redis in standalone, master/slave, or cluster mode. Ideally the minimum configuration is master/slave with sentinels.

For more information on Redis sentinels, refer to Redis Sentinel Documentation.

Sentinels

A sentinel is a component of Redis that keeps an eye on both the master and the slave. It identifies when the master goes down and immediately promotes the slave as the master. Ideally the minimal configuration has two sentinels, one for master and one for slave. When the sentinel switches the master, CSM switches as well if both are listed in Connect to field on the Server Manager.

Master/Slave

This configuration is only required if operating Redis as a high availability service. If an organization wants to horizontally scale Cherwell services, only one Redis server is required.

A master/slave connection has one copy of the master data kept in a slave. The slave and master both must be configured via the Server Manager, including both IPs and both ports with the same password. If there is a cluster of Redis, add the IP of the cluster in Host field on the Server Manager. If master and slave copy each other, one is always master and one is slave. If the master goes down, the slave does not know unless there is a sentinel. If the master goes down, it becomes the slave when it comes up again. CSM does not need to know who is master and who is slave, just the nodes for Redis in the chain.

Backup vs. Slave

Redis, by default, is setup to backup information to disk every second, but it causes slowdowns. When Redis is installed, the configuration file has a save directive with parameters. Turn off the save to disk by deleting the directive or commenting it out. Use a master/slave configuration to provide backup functionality. There are some points to remember:
  • If all of Redis goes down and the Customer does not have the save to disk feature, then everyone will be logged off and can log on again when it comes up.
  • If all of Redis goes down and the Customer does not have save to disk feature, then there is no way to predict how the server farm will behave because it errored out and IIS went down. This is why the save directive is not recommended.