How to optimize azure cache for redis

Server-Side issues such as Bandwidth limitations, High CPU usage than recommended, Increased server loads, and Memory pressure on Redis Server can affect the performance of Azure Cache as well as the Virtual Machine hosting the server.

Here at Ibmi Media, as part of our Server Support Services , We have helped numerous customers to solve Redis related issues.

In this context, we shall discuss the approaches to take in order to check these Azure Cache for Redis server-side issues for optimization.

How to troubleshoot and optimize Azure Cache for Redis Server-side issues?

Different factors can affect the performance of Azure Cache such as;

i. Limitations in the Server-Side Bandwidth
ii. Using conflicting and Long-running commands
iii. Persistent Redis Server Memory Pressure
iv. Increased CPU usage
v. High Server Loads

We shall take a look at these issues briefly.

Limitations in the Server-Side Bandwidth

Via the Azure portal, you can monitor the server-side bandwidth usage with the "Cache Read" and "Cache Write" metrics.

When the used bandwidth of the Server exceeds the available bandwidth capacity, it causes severe problems in performance and makes it slow for the data to be delivered to the client as expected.

To solve this bandwidth issues, apply the following tips;

i. Upgrade to a much larger cache size with an increased network bandwidth capacity.
ii. Make changes to the client behavior to minimize the demand of the network.
iii. Utilize alerts features such as cache write or cache read to enable you get notifications whenever the capacity is running out.

Optimizing Server Loads or Increased CPU usage

Increased Server loads and High CPU usage can affect the performance of the server greatly. To optimize the Server loads and CPU, first do an investigation about what is causing such CPU usage spike and ensure that the memory pressure is stabilized.
You can scale the Cache size to a larger one with an increased CPU capacity.

Using conflicting and Long-running commands

Redis command uses single-thread for processing requests which usually takes some time to run. These requests takes lots of Server resources which in turn affects the performance of Redis Server.
To reduce CPU spikes, simply do not use KEYS command which is an O(N) operation when conducting SCAN process.
For optimization it is recommended to use SLOWLOG command to enable you monitor conflicting commands used in Redis operation processing.

Need support in fixing Redis errors? We are here to help you.


Factors such as memory pressure, high CPU usage, Bandwidth limitations, and Server loads on server side can result in poor performance of Azure Cache for Redis and the Server in general.