Redis & Drupal @ Byte webhosting

This blog post about Redis implementation on a Drupal 7 website is written by our guest blogger and Drupal addict Bas Vredeling (codeculture.nl). He wrote and published a short dutch tutorial on how to configure Redis cache on a Drupal 7 site on our hosting platform. backlink

Hosting provider Byte has implemented a caching service Redis. Cache is served directly from memory and therefore much faster than Drupal native file cache or database caching methods. Redis can be compared with other caching mechanisms such as Memcache and APC.

Installation and configuration of Redis on a Drupal 7 based website is a piece of cake. Follow the steps below and you’ll be an active user of Redis in no time. You’ll gain significant speed boost for requests in cache. A quick benchmark showed me 20% speed improvement for anonymous visitors. When you’re going to cache specific Drupal blocks even your logged in users might profit from these speed improvements.

Here’s how to install Redis on Drupal 7 at Byte:

  1. download and install Redis module https://drupal.org/project/redis. I prefer  /sites/all/modules/contrib/redis (change path settings when installing somewhere else)
  2. when using Redis from Byte you’ll receive server name, port and password. You’ll need them in the configuration of Redis. These settings can be found on the Redis page of Byte control panel.
  3. change settings.php of the website you’re activating Redis on. Mostly it’s  /sites/default/settings.php.
  4. add the following lines at the bottom of settings.php:

Extra notes:

  • Check the status of Redis module from Byte controle panel in status reports of your Drupal site: http://example.com/admin/reports/status
  • Empty Redis cache on Byte control panel…. just to be sure. Especially if you have used other cache methods.
  • Read README.txt, README.php and Redis.txt from the module directory for more configuration settings.
  • Enabling the module is not strictly necessary for its operation.
  • Enabling the module allows you to use a configuration page on http://example.com/admin/config/development/performance/redis
  • Note: this configuration page will not work since we’ve forced it’s settings in settings.php using the tutorial above.
  • Redis cache will me more effective when you cache more Drupal elements. For instance: entitycache, authcache, views_content_cache, panels_page_cache, panels_hash_cache en cache_actions.
  • Read the Drupal documentations for more options about caching: https://drupal.org/node/326504
  • Note: using multiple caching options can conflict. It’s useless to use both memcache and Redis.
  • Note: caching your website will improve performance. But actions such as site configuration, editing, per-user content and testing might make your site more complex when you forget that you’re looking at a page from cache rather than a fresh new page.

 

 

Meer lezen over Redis: