---
title: "How to Setup & Use High Performance Redis In Magento 2 Database"
url: "https://magecomp.com/blog/setup-use-high-performance-redis-magento-2-database/"
date: "2017-10-09T10:36:59+00:00"
modified: "2025-02-22T06:43:44+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 423
reading_time: "3 min read"
summary: "Nowadays, Store owners are adopting the new &amp; improved Magento 2.0 Environment because of its new design, security and optimized performance but still they keep looking for better ways to optim..."
description: "Enabling default cache management will help Magento a bit to improve performance but another great way to boost website performance is to use faster backend ..."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "Magento 2: How to Set Character Limit for Customer Firstname and Lastname on Checkout Shipping Page"
    url: "https://magecomp.com/blog/magento-2-set-character-limit-for-customer-firstname-and-lastname-on-checkout-shipping-page/"
  - title: "Magento 2: How to Add Sample CSV Download Option in System Configuration"
    url: "https://magecomp.com/blog/magento-2-add-sample-csv-download-option-in-system-configuration/"
  - title: "Magento 2: How to Get all Module List Programmatically"
    url: "https://magecomp.com/blog/magento-2-get-all-module-list-programmatically/"
---

# How to Setup & Use High Performance Redis In Magento 2 Database

_Published: October 9, 2017_  
_Author: Dhiren Vasoya_  

![How to Setup and use High performance Redis In Magento 2 Database](https://magecomp.com/blog/wp-content/uploads/2017/10/How-to-Setup-and-use-High-performance-Redis-In-Magento-2-Database-1024x332.webp)

Nowadays, Store owners are adopting the new & improved Magento 2.0 Environment because of its new design, security and optimized performance but still they keep looking for better ways to optimize Magento store. Enabling default cache management will help a bit to improve performance but another great way to boost website performance is to use faster backend cache system.

[![Magento version upgrade](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Version-Upgrade-CTA-2-2.webp)](https://magecomp.com/services/magento-upgrade-services/)

So, the next question arises is, what is faster & alternative cache system for Magento 2?
Answer is Redis.

**What is Redis?**
Among available all alternatives, Redis is an open source, in-memory data structure store, used as a database, cache and session storage. It provides very fast backend cache with full cache support that doesn’t require low-level file system cache and stable performance for high traffic Magento stores.

**Advantages of Redis:**

- Provides extreme in-memory storage
- Vertical & Horizontal Scaleable
- Can be Shareable among Multiple Servers
- Supports cache tag

Also, the requirements of Redis is very simple like.

- Redis Server
- PHP Redis Extension

## Setting Up Redis as Cache Storage in Magento 2

Default Magento 2 Supports all Redis pre-requirement out of box so you don’t need to worry more, all you need to do is just add following code to your **Magento Root/app/etc/env.php**

```
'cache' =>
 array (
 'frontend' =>
	array (
 	'default' =>
   	array (
     	'backend' => 'Cm_Cache_Backend_Redis',
          'backend_options' =>
       	array (
         	'server' => '127.0.0.1', or ‘localhost’,
         	'port' => '6379',
             'persistent' => 0,
             'database' => '0',
             'force_standalone' => '0',
             'connect_retries' => '10',
             'read_timeout' => '30',
             'automatic_cleaning_factor' => '0',
 	        'compress_data' => '1',
             'compress_tags' => '1',
             'compress_threshold' => '20480',
             'compression_lib' => 'gzip',
     	),
 	),
  ),
),
```

### [![Magento Malware Removal](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-Malware-Removal-CTA-6.webp)](https://magecomp.com/magento-malware-removal.html)

### Setting Up Redis as Session Storage in Magento 2

```
'session' =>
  array (
	'save' => 'redis',
	'redis' =>
   	array (
    	'host' => '127.0.0.1', or ‘localhost’,
    	'port' => '6379',
    	'password' => '',
    	'timeout' => '5',
        'persistent_identifier' => '',
    	'database' => '1',
        'compression_threshold' => '2048',
    	'compression_library' => 'gzip',
    	'log_level' => '1',
        'max_concurrency' => '6',
        'break_after_frontend' => '5',
        'break_after_adminhtml' => '30',
        'first_lifetime' => '600',
        'bot_first_lifetime' => '60',
   	 'bot_lifetime' => '7200',
        'disable_locking' => '0',
        'min_lifetime' => '60',
        'max_lifetime' => '2592000'
	)
)
```

By implementing above code, it will successfully install Redis and help you boosting your website performance. Let me know in the comment section if you have any ideas or issuse in implementing this code. I’ll be happy to help you!

[![Magento 2 Speed & Performance Optimization Services](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Speed-Performance-Optimization-Services-CTA-2.webp)](https://magecomp.com/magento-performance-optimization.html)
Happy Coding!


---

_View the original post at: [https://magecomp.com/blog/setup-use-high-performance-redis-magento-2-database/](https://magecomp.com/blog/setup-use-high-performance-redis-magento-2-database/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-07-23 16:40:01 UTC_  
