The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

redis-traffic-stats - Redis query analyzer for counting, traffic stats by command

SYNOPSIS

redis-traffic-stats -r pcapfile [-n top_n] [-p port]

A) Analyze existing pcap file (RECOMMENDED WAY)

    # tcpdump -s 65535 tcp port 6379 -w redis.pcap -i eth0
    (wait for a while and stop by ^C)
    $ redis-traffic-stats -r redis.pcap

redis-traffic-stats [-n top_n] [-p port] [-i device] [-c count_capture] [-t time_capture]

B) Capture packets on demand and analyze it

    Capture 5000 packets
    # redis-traffic-stats -i eth0 -c 5000
    
    Capture for 10 sec
    # redis-traffic-stats -i eth0 -t 10

redis-traffic-stats -h | --help | -?

Show detailed usage

DESCRIPTION

redis-traffic-stats is a query analyzer for Redis.

The output looks as follows:

Total network traffic and average of bytes/sec
Total number of requests and average and peak of req/sec
Top commands of count, percentage, req/sec by count
Top commands of network traffic and byte/sec by amount of traffic
Top keys for each command show bytes, byte/sec, count, percentage, req/sec
Worst slow requests

OPTIONS

-r pcapfile:Str, --pcapfile pcapfile:Str

Read existing pcap file instead of on demand packet capturing.

    # tcpdump -s 65535 tcp port 6379 -w redis.pcap -i eth0
-p port:Int, --port port:Int

Target port of analyze. Default is 6379.

-n top_n:Int, --top top_n:Int

Show top N keys in "Command Detail" section. Default is 10.

-i device:Str, --device device:Str

Network interface name used by -i option of tcpdump. Default is no -i option (lowest numbered interface excluding loopback device).

This option has a point only in on demand packet capture mode.

-c count:Int, --count count:Int

tcpdump will exit after captured number of this option packets. Default is 10000.

-t time:Int, --time time:Int

tcpdump will exit after number of this option seconds.

-d, --debug

increase debug level. -d -d more verbosely.

SEE ALSO

https://github.com/hirose31/redis-traffic-stats

AUTHOR

HIROSE Masaaki <hirose31@gmail.com>