Skip to content

πŸ”Ž Analyzing memory of redis is to find the keys(prefix) which used a lot of memory, export the analysis result into csv file.

License

Notifications You must be signed in to change notification settings

hhxsv5/redis-memory-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Redis memory analysis

πŸ”Ž Analyzing memory of redis is to find the keys(prefix) which used a lot of memory, export the analysis result into csv file.

Requirements

  • PHP 5.4 or later
  • ext-redis >=2.2.8
  • predis/predis ~1.1.0

Installation via Composer(packagist)

composer require "hhxsv5/redis-memory-analysis:~1.0" -vvv

Usage

Run demo

include '../vendor/autoload.php';

use Hhxsv5\RMA\AnalyzeRedis;

$analyze = new AnalyzeRedis('127.0.0.1', 6379, '123456');

//Scan the keys which can be split by '#' ':'
//special pattern characters need to escape by '\'
$analyze->start(['#', ':']);

//Find the csv file in default target folder: ./reports
//CSV file name format: redis-analysis-{host}-{port}-{db}.csv
//The keys order by count desc
$analyze->saveReport();

CSV

License

MIT

About

πŸ”Ž Analyzing memory of redis is to find the keys(prefix) which used a lot of memory, export the analysis result into csv file.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages