> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shiftlabs.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> View and modify Redis server configuration parameters

The Redis Configuration page allows you to view and modify runtime configuration parameters. Changes take effect immediately but require `CONFIG REWRITE` to persist across server restarts.

## Key Concepts

<CardGroup cols={2}>
  <Card title="Runtime Config" icon="play">
    Parameters that can be changed without restarting Redis. Most settings support runtime modification.
  </Card>

  <Card title="Persistent Config" icon="save">
    Configuration stored in redis.conf. Use CONFIG REWRITE to save runtime changes permanently.
  </Card>

  <Card title="Read-Only Parameters" icon="lock">
    Some parameters cannot be changed at runtime and require a server restart.
  </Card>

  <Card title="Categories" icon="folder">
    Configurations are grouped by function: Memory, Persistence, Networking, Security, and more.
  </Card>
</CardGroup>

## Required Permissions

| Action               | Permission                               |
| -------------------- | ---------------------------------------- |
| View configuration   | `iam:project:infrastructure:redis:read`  |
| Modify configuration | `iam:project:infrastructure:redis:write` |

## Configuration Categories

| Category        | Description                       | Examples                                 |
| --------------- | --------------------------------- | ---------------------------------------- |
| **Memory**      | Memory limits and management      | maxmemory, hash-max-ziplist-entries      |
| **Persistence** | AOF and RDB settings              | appendonly, save, rdb-compression        |
| **Networking**  | Connection and timeout settings   | bind, port, tcp-keepalive, timeout       |
| **Security**    | Authentication and access control | requirepass, protected-mode              |
| **Replication** | Master-replica configuration      | replicaof, min-replicas-to-write         |
| **Clients**     | Client connection limits          | maxclients, client-output-buffer-limit   |
| **Logging**     | Slow log and latency tracking     | slowlog-log-slower-than, slowlog-max-len |

## How to View Configuration

<Steps>
  <Step title="Select Connection">
    Choose a Redis connection from the dropdown.
  </Step>

  <Step title="Browse Parameters">
    All configuration parameters are displayed in a searchable table.
  </Step>

  <Step title="Filter by Category">
    Use the category filter to show only parameters in a specific group.
  </Step>

  <Step title="Search Parameters">
    Type in the search box to find specific parameters by name or value.
  </Step>
</Steps>

## How to Modify Configuration

<Steps>
  <Step title="Find the Parameter">
    Search or browse to locate the parameter you want to change.
  </Step>

  <Step title="Click Edit">
    Click the edit button on the parameter row.
  </Step>

  <Step title="Enter New Value">
    Type the new value in the input field.
  </Step>

  <Step title="Save">
    Click the checkmark to apply the change. Click X to cancel.
  </Step>
</Steps>

<Warning>
  Configuration changes take effect immediately but are not persisted to redis.conf. Run `CONFIG REWRITE` in Redis CLI to save changes permanently.
</Warning>

## Common Settings

### Memory Configuration

| Parameter                  | Description                           | Default    |
| -------------------------- | ------------------------------------- | ---------- |
| `maxmemory`                | Maximum memory limit (0 = unlimited)  | 0          |
| `maxmemory-policy`         | Eviction policy when limit is reached | noeviction |
| `hash-max-ziplist-entries` | Max entries for ziplist encoding      | 512        |
| `hash-max-ziplist-value`   | Max value size for ziplist encoding   | 64         |

### Eviction Policies

| Policy              | Description                            |
| ------------------- | -------------------------------------- |
| **noeviction**      | Return error when memory limit reached |
| **allkeys-lru**     | Evict least recently used keys         |
| **allkeys-lfu**     | Evict least frequently used keys       |
| **volatile-lru**    | Evict LRU keys with TTL set            |
| **volatile-lfu**    | Evict LFU keys with TTL set            |
| **allkeys-random**  | Evict random keys                      |
| **volatile-random** | Evict random keys with TTL set         |
| **volatile-ttl**    | Evict keys with shortest TTL           |

### Client Configuration

| Parameter       | Description                                   | Default |
| --------------- | --------------------------------------------- | ------- |
| `maxclients`    | Maximum concurrent connections                | 10000   |
| `timeout`       | Client idle timeout in seconds (0 = disabled) | 0       |
| `tcp-keepalive` | TCP keepalive interval in seconds             | 300     |

### Slow Log Configuration

| Parameter                 | Description                             | Default |
| ------------------------- | --------------------------------------- | ------- |
| `slowlog-log-slower-than` | Log commands slower than N microseconds | 10000   |
| `slowlog-max-len`         | Maximum slow log entries to keep        | 128     |

<Info>
  Set `slowlog-log-slower-than` to 0 to log all commands, or -1 to disable slow logging.
</Info>

### Persistence Configuration

| Parameter     | Description                             | Default  |
| ------------- | --------------------------------------- | -------- |
| `appendonly`  | Enable AOF persistence                  | no       |
| `appendfsync` | AOF fsync policy (always, everysec, no) | everysec |
| `save`        | RDB snapshot triggers                   | Various  |

## How to Persist Configuration Changes

Runtime changes are lost on restart unless persisted.

<Steps>
  <Step title="Make Changes">
    Modify configuration parameters through the UI.
  </Step>

  <Step title="Open Redis CLI">
    Navigate to Redis > CLI or use an external Redis CLI.
  </Step>

  <Step title="Run CONFIG REWRITE">
    Execute `CONFIG REWRITE` to save current configuration to redis.conf.
  </Step>
</Steps>

```bash theme={null}
# In Redis CLI
CONFIG REWRITE
```

<Warning>
  CONFIG REWRITE requires write access to the redis.conf file. It may fail if Redis was started without a config file or lacks file permissions.
</Warning>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Cannot modify configuration" icon="circle-question">
    * You need write permission
    * Some parameters are read-only and require restart
    * The server may be in read-only mode
    * Check if the parameter name is correct
  </Accordion>

  <Accordion title="Changes not persisting after restart" icon="circle-question">
    * Run `CONFIG REWRITE` to save changes to redis.conf
    * Verify Redis has write access to the config file
    * Check if Redis was started with a config file
  </Accordion>

  <Accordion title="CONFIG REWRITE failed" icon="circle-question">
    * Redis may not have write permission to config file
    * Redis may have been started without a config file
    * File system may be read-only
    * Check Redis logs for specific error
  </Accordion>

  <Accordion title="Parameter not found" icon="circle-question">
    * Check Redis version (some parameters are version-specific)
    * Verify parameter name spelling
    * Some parameters are aliases (e.g., slaveof vs replicaof)
  </Accordion>

  <Accordion title="Invalid value error" icon="circle-question">
    * Check the expected value format
    * Memory values use K, M, G suffixes (e.g., 100mb)
    * Boolean values use yes/no, not true/false
    * Time values may be in seconds or milliseconds
  </Accordion>

  <Accordion title="Server performance degraded after change" icon="circle-question">
    * Revert the change using the same edit process
    * Common causes: maxmemory too low, aggressive eviction
    * Check Redis INFO for memory and eviction stats
    * Monitor slow log for performance impact
  </Accordion>
</AccordionGroup>

## FAQ

<AccordionGroup>
  <Accordion title="What's the difference between runtime and static configuration?">
    **Runtime** (dynamic) configuration can be changed while Redis is running using CONFIG SET. **Static** configuration requires editing redis.conf and restarting the server. Most parameters support runtime modification.
  </Accordion>

  <Accordion title="How do I find the current redis.conf location?">
    Run `CONFIG GET dir` to get the working directory and `CONFIG GET dbfilename` for the database file. The redis.conf is typically in the same directory or /etc/redis/.
  </Accordion>

  <Accordion title="What happens if maxmemory is set too low?">
    Depending on maxmemory-policy: noeviction returns errors on writes, eviction policies delete keys to free memory. Monitor evicted\_keys in INFO stats to detect excessive eviction.
  </Accordion>

  <Accordion title="Should I enable AOF or RDB persistence?">
    **RDB** provides point-in-time snapshots, good for backups but potential data loss. **AOF** logs every write, better durability but larger files. Many production systems use both.
  </Accordion>

  <Accordion title="What's a good value for slowlog-log-slower-than?">
    Default is 10000 microseconds (10ms). For production, 1000-10000 is typical. Set lower for debugging, higher if slow log fills too quickly. Use 0 to log everything.
  </Accordion>

  <Accordion title="How do I reset a parameter to default?">
    Use CONFIG SET with the default value. Alternatively, restart Redis without the parameter in redis.conf to restore defaults.
  </Accordion>

  <Accordion title="Can configuration changes affect running operations?">
    Most changes are immediate and safe. Memory-related changes may trigger eviction. Persistence changes may affect disk I/O. Test in non-production first.
  </Accordion>

  <Accordion title="Why do some parameters show empty values?">
    Empty values typically mean the parameter uses a default or is disabled. For example, an empty `bind` means Redis listens on all interfaces.
  </Accordion>
</AccordionGroup>

## Best Practices

### Before Making Changes

* Document current values before modifying
* Understand the impact of each parameter
* Test changes in non-production environments first
* Have a rollback plan ready

### Memory Configuration

* Set maxmemory to leave headroom for overhead
* Choose appropriate eviction policy for your use case
* Monitor memory usage after changes
* Consider fragmentation when setting limits

### Performance Tuning

* Start with defaults, adjust based on monitoring
* Use slow log to identify bottlenecks
* Tune tcp-keepalive based on network environment
* Adjust maxclients based on expected load

### Persistence Settings

* Balance durability vs performance with appendfsync
* Configure save points based on data change rate
* Monitor disk I/O after persistence changes
* Test backup and recovery procedures

### Security Settings

* Enable protected-mode in production
* Set strong requirepass for authentication
* Consider ACL for fine-grained access (Redis 6+)
* Limit bind addresses to required interfaces
