Redis-HA

The source code and default configuration of the Building Block is available in our GitLab.

Redis Architecture

Redis consists of 5 Pods:

2 x HAProxy
3 x Redis HA Server

Adding the Building Block

Add the directory syseleven-redis-ha to your control repository. Add a .gitlab-ci.yml to the directory with the following content:

include:
  - project: syseleven/building-blocks/helmfiles/redis-ha
    file: JobDevelopment.yaml
    ref: 1.8.1
  - project: syseleven/building-blocks/helmfiles/redis-ha
    file: JobStaging.yaml
    ref: 1.8.1
  - project: syseleven/building-blocks/helmfiles/redis-ha
    file: JobProduction.yaml
    ref: 1.8.1

Remove environments you are not using by removing their include.

Configuration

Redis maxmemory/pod limits config option

For a production-grade setup, it is highly recommended to define a maxmemory limit for Redis and resource limit for the pod.
In our experience the formula maxmemory * 125% <= limits can be used for a stable configuration.

syseleven-redis-ha/values-redis-ha.yaml

redis:
  config:
    maxmemory: 1024MB
  resources:
    limits:
      memory: 1280Mi

Monitoring

Additional alertrules

  • Redis
    • Cluster
    • Memory
    • Connections
  • HAProxy
    • Cluster
    • Connections to redis
    • Connections in general

Additional Grafana dashboards

  • Redis
    • An overview of performance metrics of Redis (e.g. memory usage, clients, hits/misses, total items, ...)
  • HAProxy
    • An overview of performance metrics of HAProxy (e.g. connections, sessions, queues, ...)

Scaling Setup

This building block consists of multiple components. Each of the components can and must be scaled individually.

Redis

See Scaling Redis for upstream documentation.

  • Amount of replicas can be adjusted
  • Requests/limits for CPU/memory can be adjusted

HAProxy

  • Amount of replicas can be adjusted
  • Requests/limits for CPU/memory can be adjusted