2 Star 5 Fork 1

谢彪 / redis-memory-analysis

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
README.md 1.03 KB
Copy Edit Web IDE Raw Blame History
XieBiao authored 2018-02-25 21:11 . emoji icon

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

Comment ( 0 )

Sign in for post a comment

PHP
1
https://gitee.com/hhxsv5/redis-memory-analysis.git
git@gitee.com:hhxsv5/redis-memory-analysis.git
hhxsv5
redis-memory-analysis
redis-memory-analysis
master

Search

102255 3a0e046c 1850385 102255 7aaa926c 1850385