Introduction

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

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

Installing Redis

  • CentOS, RedHat, and Fedora:
    • yum -y install redis
    • systemctl enable redis
    • systemctl start redis
  • Debian and Ubuntu:
    • apt-get install redis-server
    • systemctl enable redis-server.service
    • systemctl restart redis-server.service
  • Devuan:
    • apt-get install redis-server
    • service redis-server restart

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/current/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.