Sign inSign up

hoshihaya/mk-query-digest

By hoshihaya

•Updated almost 3 years ago

Image
0

189

hoshihaya/mk-query-digest repository overview

⁠mk-query-digest

MaatKit版 query-digest です。

⁠docker-compose.yml

version: '3.9'
services:
  mk-query-digest:
    image: hoshihaya/mk-query-digest
    volumes:
      - type: bind
        source: ./tcpdump
        target: /root/tcpdump/

⁠使用例

⁠DBの場合
mkdir tcpdump
file_prefix=$(hostname)-$(date +%Y%m%d%H%M)

## -G5 で 5秒パケットを取得
sudo tcpdump -i eth0:$(hostname) port 3306 -np -s 65535 -W1 -G5 -w ./tcpdump/${file_prefix}.db.pcap
sudo tcpdump -s 65535 -x -nn -q -tttt -l -r ./tcpdump/${file_prefix}.db.pcap > ./tcpdump/${file_prefix}.db.pcap.log

## 解析
docker compose run --rm mk-query-digest --type tcpdump --filter '$event->{fingerprint} !~ m/^(commit|admin|set)/' --limit 50 ./tcpdump/${file_prefix}.db.pcap.log
⁠memcached の場合
mkdir tcpdump
file_prefix=$(hostname)-$(date +%Y%m%d%H%M)

## -G5 で 5秒パケットを取得
sudo tcpdump -i eth0:$(hostname) port 11211 -np -s 65535 -W1 -G5 -w ./tcpdump/${file_prefix}.memd.pcap
sudo tcpdump -s 65535 -x -nn -q -tttt -l -r ./tcpdump/${file_prefix}.memd.pcap > ./tcpdump/${file_prefix}.memd.pcap.log

## 解析
docker compose run --rm mk-query-digest --type memcached tcpdump/${file_prefix}.memd.pcap.log

Tag summary

Content type

Image

Digest

sha256:371ece2f7…

Size

98.4 MB

Last updated

almost 3 years ago

docker pull hoshihaya/mk-query-digest