Implementing Redis on Magento 2

Magento 2 comes with native Redis support, so it is not necessary to install any supporting dependencies like on Magento 1. You just need to add the respective configuration to the Magento ./app/etc/env.php

Cache and full page cache storage

There's three elements to add for Redis; cache, full page cache and sessions.

Add the following after the opening array statement,

  'cache' =>
  array(
     'frontend' =>
     array(
        'default' =>
        array(
           'backend' => 'Cm_Cache_Backend_Redis',
           'backend_options' =>
           array(
              'server' => 'redis11.i',
              'database' => '0',
              'port' => '6379'
              ),
      ),
      'page_cache' =>
      array(
        'backend' => 'Cm_Cache_Backend_Redis',
        'backend_options' =>
         array(
           'server' => 'redis31.i',
           'port' => '6380',
           'database' => '0',
           'compress_data' => '0'
         )
      )
    )
  ),

Session storage

Replace the following,

  'session' =>
  array (
    'save' => 'files',
  ),

With,

  'session' => 
  array (
    'save' => 'redis',
    'redis' => 
    array (
      'host' => 'redis1.i',
      'port' => '6379',
      'password' => '',
      'timeout' => '2.5',
      'persistent_identifier' => '',
      'database' => '0',
      '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'
    )
  ),