Magento 2 admin loading very slow after redis configuration

Magento 2 admin loading very slow after redis configuration

October 10, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento 2 admin loading very slow after redis configuration

Solving Redis Session Lock Performance Issues in Magento 2

Slow admin loading times are a common issue when configuring Redis for session storage in Magento 2. The problem often arises from the HINCRBY command being called repeatedly, leading to locking conflicts and increased latency.

Understanding the Issue

When you configured Redis for sessions in your Magento 2.4.3 instance, it likely used the Cm_RedisSession extension by Colin Mollenhour. This extension handles session storage using Redis’ data model. However, it can sometimes lead to the issue you described—the admin panel taking a long time to load due to multiple HINCRBY requests on the same key.

The HINCRBY command is used for locking and unlocking sessions in Redis. When multiple requests arrive simultaneously, they attempt to acquire the lock, leading to delays as each request waits for its turn to proceed.

Identifying the Problem

You’ve already identified the issue through debugging—you found that Magento was making repeated HINCRBY calls with a lock key like "sess_llm5difqva5dpp995o4ansht8h". This is causing the slowdown in your admin panel as each request waits for its turn to acquire the lock.

Potential Causes and Workarounds

The issue you’re facing might be due to:

  1. High traffic volume: If your admin panel receives a lot of requests simultaneously, this can cause the locking mechanism to become congested.
  2. Insufficient Redis resources: Ensure that your Redis instance has adequate memory and CPU allocated for handling Magento’s session storage needs.

A Potential Solution: Increasing Lock Expiration Time

One approach to mitigate this issue is to increase the lock expiration time in your Redis configuration. This tells Redis to keep the lock active for a longer period, reducing the number of times it needs to be acquired.

To do this, you need to modify the lockExpireTime value in your Magento 2 config file (app/etc/config.php). Here’s an example:

"Cm_RedisSession" => [
    "active" => true,
    "redis" => [
        "host" => "127.0.0.1",
        "port" => "6379",
        "database" => 0,
        "lockExpireTime" => 60 // Increase this value, e.g., to 60 seconds
    ]
],

In the example above, we’ve increased the lockExpireTime from its default value of 1 second to 60 seconds. This tells Magento to keep the lock active for a longer period before releasing it.

Other Considerations

Remember that increasing the lock expiration time too much can lead to other issues:

  • Extended session duration: Longer locks mean sessions will remain active for an extended period, which could consume unnecessary memory.
  • Potential data inconsistency: If multiple requests update the same data simultaneously within a single lock, it might result in inconsistent or incorrect data.

Conclusion

The slow admin panel loading issue you’re experiencing is likely due to Magento’s Redis session locking mechanism being overwhelmed by simultaneous requests. While increasing the lock expiration time can provide some relief, it’s not a perfect solution and should be used judiciously.

I recommend monitoring your Redis instance closely for any signs of performance degradation or high memory usage after implementing this change. If the issue persists, you might need to consider optimizing your Magento configuration further or seeking professional assistance from our team at Laravel Company.

Remember, every Magento implementation is unique, and what works in one case might not be ideal for another. Always test changes thoroughly before deploying them to a production environment.

I hope this helps you resolve the issue with your Magento 2 Redis session configuration. Feel free to reach out if you have any other questions!

Magento 2 Cache Performance Extensions

Our network