# How to inspect Redis with Redis Insight

Redis Insight is a free desktop tool for browsing Redis and analyzing what uses memory - useful when
a cache is large or you are chasing [memory pressure](../../troubleshooting/out-of-memory.md). You
connect to your host's Redis over a secure Secure Shell (SSH) tunnel.

## Before you start

- **SSH access** and your system-user credentials from the host's
  [Credentials](../../platform/hosts/credentials.md) tab.
- No Redis password is needed. Access is secured by the SSH tunnel and by Redis binding to
  localhost, so leave the password field empty.

## Connect

1. In Redis Insight, select **Add Redis Database**.
2. Enter the connection details:
   - **Host:** `127.0.0.1` and **Port:** `6379` (the cache instance) or `6378` (the persistent
     instance).
   - Under **Security**, enable **Use SSH Tunnel**: SSH host = your server, **port 22**, and your
     system-user name and password.
3. Open the database. Pick the logical database to analyze (the default is `0`); you can list them
   over SSH with:
   ```bash
   redis-cli info keyspace
   ```

## Which instance and database

TurboStack runs two Redis instances. Connect to the one that holds the data you want to inspect:

| Instance | Port | Holds |
| --- | --- | --- |
| Cache | `6379` | Temporary cache; cleared by `tscli redis clear` |
| Persistent | `6378` | Sessions and data that must survive a restart |

Each instance has 16 logical databases, numbered `0` to `15`. When a host runs several sites, each
site often uses its own database. Use the keyspace list above to find the database with the keys you
want.

## Analyze memory use

Browse keys to see their types and time-to-live (TTL), then use the **Analysis** tool in the left
menu to generate a report. The report shows:

- Total memory used and the total number of keys.
- The largest keys, sortable by TTL, so you can see what is worth caching differently.
- The most used key types and how much memory each type takes.
- The memory split between expiring and non-expiring keys.

Use this to decide what to cache differently, or whether to raise `redis_memory` - see
[Performance tuning](../../concepts/performance-tuning.md).

## Related

- [What is Redis?](what-is.md)
- [Configure Redis](configure.md)
- [Out of memory](../../troubleshooting/out-of-memory.md)
- [Performance tuning](../../concepts/performance-tuning.md)
