Skip to content

Redis Memory Optimization

After reading this page you can interpret the Redis Settings card on the System Optimization page and set a Redis maxmemory limit that protects the rConfig host. From V8.4.0, rConfig reports Redis memory use and flags an unlimited or undersized limit.

Use this page when the Redis Settings card shows Needs Optimization, or when the host runs low on memory during large backup or report runs. Redis holds the job queue, the cache, sessions, and Horizon’s own records, so a large queue backlog shows up here first.

  • rConfig V8.4.0 or later
  • Root or sudo access to the server running Redis
  • Access to System Settings >> System Optimization in rConfig
  • The host’s total RAM, so you can choose a limit from the guidelines below

What does the Redis Settings card show? (V8.4.0+)

Section titled “What does the Redis Settings card show? (V8.4.0+)”

Navigate to System Settings >> System Optimization. The Redis Settings card sits below Horizon Settings and contains three rows.

SettingWhat it reportsWhen it is optimal
redisConnection status and Redis server versionrConfig can connect to Redis
used_memoryMemory Redis is using now. The Information column also shows the peak since Redis started and the resident (RSS) sizeUsage is under 80% of maxmemory, or under 80% of a quarter of host RAM when no limit is set
maxmemoryThe configured Redis memory limit, or 0 (unlimited)A limit is set and it is at or above the peak already seen

The suggested maxmemory value is a quarter of host RAM, rounded to the nearest GB, with a minimum of 512MB. On a 16GB host the card suggests 4GB or more.

If the redis row shows error, rConfig could not read Redis server information. The error message appears in the Information column. Check that Redis is running and that the REDIS_HOST, REDIS_PORT, and REDIS_PASSWORD values in .env are correct.

Why does an unlimited maxmemory need optimization?

Section titled “Why does an unlimited maxmemory need optimization?”

With maxmemory set to 0, Redis grows until the host itself runs out of memory. The kernel then kills processes to recover, and the victim is often MariaDB or a Horizon worker rather than Redis. A limit above the observed peak means a runaway queue fails loudly with Redis write errors, while the rest of the host stays up.

Why is my limit flagged when it is already set?

Section titled “Why is my limit flagged when it is already set?”

The card flags a limit that is below the used_memory peak since Redis started. A workload of the same size would hit the limit and Redis would refuse writes, so queued jobs would fail. Raise the limit above the peak shown in the Information column.

  1. Note the Suggested Value and the peak memory shown on the Redis Settings card.
  2. Choose a limit that is at or above the suggested value and comfortably above the peak.
  3. Open the Redis configuration file:
Terminal window
# RHEL 9 family. On RHEL 8 the file is /etc/redis.conf
sudo cp /etc/redis/redis.conf /etc/redis/redis.conf.bak
sudo vi /etc/redis/redis.conf
  1. Find the maxmemory directive, uncomment it, and set your chosen limit:

    maxmemory 4gb
    maxmemory-policy noeviction
  2. Save the file and restart Redis:

Terminal window
sudo systemctl restart redis
  1. Confirm Redis picked up the new limit:

    Terminal window
    redis-cli CONFIG GET maxmemory

    Add -a <password> if REDIS_PASSWORD is set in .env. The value is returned in bytes.

  2. Return to System Settings >> System Optimization and click Refresh. The maxmemory row shows Optimal once the limit is at or above the peak.