Introduction

Enswitch can be configured to use Redis to cache database lookups. This can improve speed and reduce MySQL load.

The Redis server should be installed on a machine that's not one of the Enswitch machines.

Please note that this is experimental. Before configuring this, please contact Enswitch support to discuss which tables to cache.

Installing Redis

  • On machines running Debian or Ubuntu:
    • apt-get install redis-server
    • systemctl enable redis-server.service
    • systemctl restart redis-server.service
  • On machines running CentOS, Redhat Enterprise, or Fedora:
    • yum -y install redis
    • systemctl enable redis
    • systemctl start redis

Configuring Enswitch to use Redis

  • Modify /etc/redis/redis.conf (or /etc/redis.conf) and uncomment "unixsocket /path-to/redis-server.sock" and "unixsocketperm 777"
  • Restart Redis.
  • Create /etc/enswitch/redis.ini by doing:
    • cp /opt/enswitch/install/etc/enswitch/redis.ini /etc/enswitch/redis.ini
    and then editing /etc/enswitch/redis.ini to suit. Set the Unix socket to the file used in redis.conf. In the [tables] section, set the number of seconds to cache each table for. Any table that is not listed, or has zero seconds set, will not be cached.
  • Activate redis caching in databases.ini by adding the following line to the [default] section:
    cache = redis
  • Run "enswitch restart" to make the changes take effect.