## TL;DR

'max number of clients reached' after days or weeks means connection accumulation: timeout set to 0 keeps idle connections open forever, or maxclients is too low for the pattern. Set an idle timeout (120 seconds or more) so stale clients are reaped, and size maxclients for your actual concurrency.

## Fix

1. 'max number of clients reached' after days or weeks means connection accumulation: timeout set to 0 keeps idle connections open forever, or maxclients is too low for the pattern.
   Expected: You get the expected result; the problem is gone.
2. Set an idle timeout (120 seconds or more) so stale clients are reaped, and size maxclients for your actual concurrency.
   Expected: You get the expected result; the problem is gone.
3. Verify with CLIENT LIST and watch the connection count trend after the change.
   Expected: You see the expected output instead of the problem.

## When to use

- You are setting up or using this Redis 'max number of clients reached' feature.
- The symptom matches: set a connection timeout.

## When NOT to use

- Unrelated Redis 'max number of clients reached' issues (different feature, different failure).
- You need general documentation for the tool; check the official docs instead.

## Compatibility

Reported against Redis 'max number of clients reached'. Source: https://github.com/classic298/docs/blob/HEAD/docs/tutorials/integrations/redis.md.

## Variant phrasings

### set a connection timeout

## Why it happens

A Redis that runs fine for weeks then refuses connections is leaking clients.

## Edge cases

- If your error message differs even slightly, this is probably a different issue; search the exact text.
- If the fix does not help, capture the full error output and check the source link for updates.

## Source

https://github.com/classic298/docs/blob/HEAD/docs/tutorials/integrations/redis.md