radioactivity_redis
Radioactivity Redis provides a Redis-based incident storage backend for the Radioactivity module. It includes a lightweight PHP endpoint that bypasses Drupal bootstrap entirely and stores incidents in Redis, significantly reducing server load on high-traffic sites.
Radioactivity's default storage bootstraps Drupal on every page view just to record an incident. The built-in REST storage avoids bootstrap but cannot accept incidents from PHP code (addIncident() throws an exception). Redis storage combines the best of both: a fast no-bootstrap endpoint with PHP addIncident() support, allowing modules to add incident energy to entities in custom code for actions other than views.
Features
- Lightweight endpoint that skips Drupal bootstrap
- Supports both PhpRedis extension and Predis library
- Incidents from both JS and PHP are stored in the same Redis list and processed together during cron
- Full
addIncident()support from PHP (unlike REST file storage)
Storage Comparison
- Default (DB) - Full Drupal bootstrap, supports PHP
addIncident(), stores in database table - REST (file) - No bootstrap, but
addIncident()throws an exception, stores in JSON file - Redis - No bootstrap, supports PHP
addIncident(), stores in Redis list
Requirements
- Radioactivity ^4
- Redis server
- PhpRedis extension (recommended) or predis/predis library
Installation
There are a few extra steps to get this running than a typical module. See the README for configuration steps including Redis connection settings and .htaccess setup.