---
name: databases-for-redis-howto-managing-connections
title: Managing connections
description: Connections to your IBM Cloud&reg; Databases for Redis deployment use resources, so it is important to consider how many connections you need to tune your deployment's performance.
last-updated: 2024-12-02
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/databases-for-redis?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

# Managing connections
{: #managing-redis-connections}

Connections to your IBM Cloud&reg; Databases for Redis deployment use resources, so it is important to consider how many connections you need to tune your deployment's performance. 
{: .shortdesc}

## Redis connection limits 
{: #managing-redis-connection-limits}

At provision, IBM Cloud&reg; Databases for Redis sets the maximum number of connections to your Redis deployment to **10,000**. Leave some connections available, as a number of them are reserved internally to maintain the state and integrity of your database. 

Exceeding the connection limit for your deployment can make your database unreachable by your applications. If your connection limit is reached, you see the following error.

```sh
ERR max number of clients reached
```

### Checking Redis connection limits
{: #checking-redis-connections}

To display your current client connections, use the following CLI command with your [admin user](https://cloud.ibm.com/docs/databases-for-redis?topic=databases-for-redis-user-management&format=markdown#the-admin-user).

```sh
CLIENT LIST
```

The output can be filtered.

```sh
CLIENT LIST TYPE NORMAL
```

For more information, see [Redis CLIENT LIST documentation](https://redis.io/commands/client-list/){: .external}.

## Ending Redis connections
{: #managing-redis-connections-end}

Due to the single-threaded nature of Redis, it is not possible to end a client connection while it is running a command. From the client point of view, the connection can never be closed in the middle of the execution of a command. However, the client will notice that the connection is closed only when the next command is sent (and results in network error).

The `CLIENT KILL` Command closes a client connection. 

For more information, see [Redis CLIENT KILL documentation](https://redis.io/commands/client-kill/){: external}.

## Redis connection pooling
{: #managing-redis-connection-pooling}

One way to prevent exceeding the connection limit and ensure that connections from your applications are being handled efficiently is through connection pooling. Connection pooling minimizes the number of active connections against your deployment. For more information, see [The Pooling of Connections in Redis
](https://medium.com/geekculture/the-pooling-of-connections-in-redis-e8188335bf64){: .external}.

## Redis Context-based restrictions and Allowlisting
{: #managing-redis-allowlisting}

You can also use Context-based restrictions or allowlisting to manage and/or limit connections to your Redis deployment. For more information, see [Context-based restrictions](https://cloud.ibm.com/docs/databases-for-redis?topic=databases-for-redis-cbr&interface=ui&format=markdown) or [Allowlisting](https://cloud.ibm.com/docs/databases-for-redis?topic=databases-for-redis-allowlisting&format=markdown).