Azure Cache Redis
Azure Redis Cache is low-latency, scalable, secure, and highly available in-memory Redis data store available for Azure.
Made by
Massdriver
Official
Yes
Clouds
Tags
Azure Cache for Redis
Azure Cache for Redis is a managed, in-memory cache service that can be used to improve the performance and scalability of applications. It allows you to store and retrieve data from a high-throughput and low-latency cache and supports features such as persistent storage and failover.
Design Decisions
- System-Assigned Managed Identity: The Redis Cache uses a system-assigned identity for secure and streamlined resource access.
- Networking: By default, the Redis Cache is placed within a specified subnet in an Azure Virtual Network to control access.
- Data Persistence: The module supports RDB and AOF persistence configurations. RDB (Redis Database Backup) creates snapshots of your cache at specified intervals, while AOF (Append Only File) logs every write operation received by the server.
- Monitoring and Alerts: Automated alarms for CPU usage, memory usage, and server load are predefined.
Runbook
Redis Cache Connection Issues
If you experience connection issues to the Azure Redis Cache instance, the following Azure CLI and Redis CLI commands can help troubleshoot the problem.
Check the status of the Redis Cache instance:
az redis show --name <redis-cache-name> --resource-group <resource-group-name>
Expected Output: The status of the Redis Cache instance should be "Running."
Attempt to connect using the Redis CLI:
redis-cli -h <redis-cache-hostname> -p <redis-cache-port> -a <redis-cache-password>
Expected Output: A successful Redis connection prompt (<hostname>:<port>
).
High CPU Usage
To determine if your Redis Cache is experiencing high CPU usage, use the Azure Monitor metrics.
Check Redis Cache CPU usage with Azure CLI:
az monitor metrics list --resource <redis-cache-id> --metric allpercentprocessortime --interval PT1H
Expected Output: Metrics data showing CPU usage over the specified interval.
High Memory Usage
High memory usage can degrade the performance of the Redis Cache. Verify memory usage with the following command:
az monitor metrics list --resource <redis-cache-id> --metric allusedmemorypercentage --interval PT1H
Expected Output: Metrics data showing memory usage over the specified interval.
Unable to Perform Backup
Ensure that the storage account used for Redis persistence is correctly configured.
Verify storage account configuration:
az storage account show --name <storage-account-name> --resource-group <resource-group-name>
Expected Output: The storage account details with correct configuration parameters (e.g., Premium, LRS, available access keys).
Check Redis backup settings:
CONFIG GET dir
CONFIG GET dbfilename
Expected Output: Successfully retrieved configuration settings for the backup directory and database filename.
Slow Performance
If the Redis Cache is experiencing slow performance, check the server load and connected clients.
Monitor server load:
az monitor metrics list --resource <redis-cache-id> --metric serverLoad --interval PT1H
Expected Output: Metrics data indicating server load over the specified interval.
Check connected clients using Redis CLI:
CLIENT LIST
Expected Output: List of clients connected to the Redis Cache, including their details such as address and idle time.
Variable | Type | Description |
---|---|---|
cluster.enable_cluster | boolean | Redis cluster automatically shards data across multiple Redis nodes, so you can create workloads of bigger memory sizes and get better performance. This cannot be disabled after deployment. |
monitoring.mode | string | Enable and customize Function App metric alarms. |
redis.capacity | integer | The size of the Redis memory cache. |
redis.non_ssl_port | boolean | Enable the non-SSL (6379) port. SSL port (6380) is enabled by default. Enabling this is not recommended as it will allow unencrypted communication, which poses a security risk. |
redis.persistence | string | Redis persistence allows you to persist data stored in Redis in the event of an outage. This cannot be changed after deployment |
redis.redis_version | string | Azure Cache for Redis offers the latest major version of Redis and at least one previous version. The version can be upgraded, but not downgraded. |
redis.replicas_per_primary | integer | Number of read replicas per primary node. When the primary VM becomes unavailable, the replica detects that and takes over as the new primary automatically. This cannot be changed after deployment. |