https://github.com/fgm/drupal_redis_stats
Report on Drupal 11 / Drupal 10 / Drupal 9 cache bins stored in Redis
https://github.com/fgm/drupal_redis_stats
drupal-10 drupal-11 drupal-9 monitoring observability redis-server
Last synced: about 1 year ago
JSON representation
Report on Drupal 11 / Drupal 10 / Drupal 9 cache bins stored in Redis
- Host: GitHub
- URL: https://github.com/fgm/drupal_redis_stats
- Owner: fgm
- License: gpl-3.0
- Created: 2020-03-19T15:22:15.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-02-27T09:09:25.000Z (over 2 years ago)
- Last Synced: 2025-02-13T01:32:20.612Z (over 1 year ago)
- Topics: drupal-10, drupal-11, drupal-9, monitoring, observability, redis-server
- Language: Go
- Homepage: https://www.drupal.org/project/redis
- Size: 106 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Drupal Redis Stats
==================
[](https://godoc.org/github.com/fgm/drupal_redis_stats)
[](https://goreportcard.com/report/github.com/fgm/drupal_redis_stats)
[](https://travis-ci.org/fgm/drupal_redis_stats)
[](https://codecov.io/gh/fgm/drupal_redis_stats)
[](https://securityscorecards.dev/viewer/?uri=github.com/fgm/drupal_redis_stats)
[](https://app.fossa.com/projects/custom%2B11916%2Fgithub.com%2Ffgm%2Fdrupal_redis_stats?ref=badge_shield)
This command provides a summary of the use of a Redis database by the
Drupal 10 or Drupal 9 cache provider.
It relies on Redis `SCAN` operator instead of `KEYS`, so it won't block your
site when used on production.
## Installing
Assuming Go 1.21 or later installed:
```
go get -u github.com/fgm/drupal_redis_stats
```
## Using
### Flags
- `-h` provides help
- `-dsn` flag allows using a non-default Redis
- `-dsn redis://:/` without authentication
- `-dsn redis://@:/` for `requirepass` AUTH mode
- `-dsn redis://:@:/` for ACL AUTH mode
- `-json` provides JSON output instead of the default human-readable format
- `-q` disables the progress bar used during the database SCAN loop
### Sample results
```
Bin | Entries | Size
-------------------+---------+---------
bootstrap | 10 | 6056
config | 7992 | 4741812
data | 10483 | 7717813
default | 183 | 130061
discovery | 240 | 164028
dynamic_page_cache | 6104 | 11225548
entity | 785 | 506817
menu | 28 | 30646
page | 6125 | 5222326
render | 12877 | 19965812
-------------------+---------+---------
Total | 44832 | 49714857
```
The _Entries_ column provides the number of entries in a cache bin,
while the _Size_ bin provides the size used by keys and data in Redis
storage, based on information provided by the `MEMORY USAGE` command.