Magento Redis session Issue: after few hours website slows down

Magento Redis session Issue: after few hours website slows down

October 9, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento Redis session Issue: after few hours website slows down

Magento Redis Session Issue: Slow Performance After Few Hours

Are you experiencing slow performance issues with your Magento CE 1.9.2.4 website after enabling Redis for session storage? You’re not alone. I’ve encountered this issue and found several ways to troubleshoot and resolve the problem.

Understanding the Issue

When using Redis as a session storage provider in Magento, you might face unexpected slowdowns after a few hours of operation. This often results in extremely long loading times—up to one minute or more—for your storefront pages while leaving the admin zone unaffected.

The underlying cause is not always clear but can stem from several factors:

  1. Insufficient Redis resources: If your Redis server lacks adequate memory or performance capabilities, it may struggle under heavy load.
  2. Misconfigured session settings: Incorrect configuration of Magento’s session and Redis settings can lead to excessive resource usage.
  3. Database connectivity issues: Poor database performance or network problems between your webserver and the database can exacerbate the situation.

Troubleshooting Steps

To identify and resolve the issue, follow these troubleshooting steps:

1. Monitor Resource Usage

Regularly monitor your server’s resource usage to understand where the bottleneck lies. Use tools like htop or top on Ubuntu-based systems to track CPU and memory consumption by your webserver (Nginx) and Redis processes.

You may notice that Redis is consuming a significant amount of memory, eventually leading to increased swap usage as shown in the provided screenshot.

2. Review Magento Configuration

Double-check your local.xml configuration file for any inconsistencies or misconfigurations:

  • Ensure the session_save directive is set correctly (in this case, it’s already set to db, which is not the issue).
  • Verify that Redis session settings are properly configured under the <redis_session> section.
  • Check if there are any duplicate or conflicting configuration directives.

3. Optimize Redis Configuration

Review and optimize your Redis configuration file (/etc/redis.conf on Ubuntu):

  1. Increase memory allocation: Adjust the maxmemory setting to allocate more memory for Redis, ensuring it aligns with your server’s available RAM.
  2. Configure eviction policies: Set appropriate eviction policies (e.g., maxmemory-policy allkeys-lru) to handle overflow situations gracefully.
  3. Tune persistence settings: Fine-tune the save directive and dir option to manage data persistence effectively.

4. Optimize PHP and HHVM Configuration

Review your PHP or HHVM configuration file (php.ini for PHP, not applicable in this case) and make necessary adjustments:

  • Ensure the session-related directives (e.g., session.save_handler, session.save_path, session.gc_maxlifetime) are configured correctly.
  • Optimize other settings like memory_limit, max_execution_time, and post_max_size to suit your application’s needs.

5. Analyze Database Performance

Investigate the performance of your MySQL/MariaDB database:

  1. Check query performance: Use tools like the slow query log or EXPLAIN statements to identify any slow-running queries.
  2. Optimize indexes: Ensure that all tables have appropriate indexes to speed up data retrieval and reduce query execution time.
  3. Configure MySQL/MariaDB settings: Fine-tune your database configuration file (my.cnf) by adjusting buffer sizes, connection limits, and other relevant parameters.

Based on my experience, these solutions should help you resolve the slow performance issue:

  1. Upgrade your server hardware: If possible, upgrade your server’s RAM or CPU to provide more resources for Redis and your webserver.
  2. Optimize session configuration: Fine-tune Magento’s session settings by adjusting the session_cache_limiter directive in .htaccess or index.php.
  3. Use PHP-FPM instead of HHVM: If you’re using HHVM, consider switching to PHP-FPM with the latest stable PHP version for better performance and compatibility.
  4. Implement caching mechanisms: Use caching solutions like Varnish or Redis Page Cache to reduce the load on your server and database.

Conclusion

Slow performance issues with Magento and Redis can be challenging to diagnose and resolve. However, by carefully monitoring resource usage, optimizing configurations, and implementing best practices, you can significantly improve your website’s performance.

Remember to regularly update your Magento version, maintain your server software up-to-date, and follow the Magento best practices for optimal results.

Magento 1 Cache Database Performance

Our network