• tcprstat 很不错的服务器时延统计工具


    tcprstat 是一个很不错的网络通信检测,可以支持多种应用协议的处理

    安装

    git clone https://github.com/y123456yz/tcprstat.git
    yum -y install bison yacc flex  glibc-static  libcap-devel
    ./configure
    make &&  make  install
    • 支持的命令
    ./tcprstat --help
    tcprstat 0.3.1, libpcap version 1.1.1.
    Usage: tcprstat [--port <port>] [--format=<format>] [--interval=<sec>]
                 [--header[=<header>] | --no-header] [--iterations=<it>]
                 [--read=<file>]
           tcprstat --version | --help
        --read <file>, -r    Capture from pcap file <file>, not live.
        --time <ms>, -T     time delay > -T(time) count stastic.
        --log  <file>, -o   if time dealy > -T(time), timestamp record to log file.
        --local <addresses>, -l
                             <addresses> is a comma-separated list of ip
                             addresses, which are used as the local list of
                             addresses instead of pcap getting the list.
                             This is useful when working with a pcap file got
                             from another host with different addresses.
        --port <port>, -p    Capture traffic only for tcp/<port>.
        --format <format>, -f
                             Output format. Argument is a string detailing
                             how the information is presented. Accepted codes:
                                 %n - Response time count
                                 %a - Response time media in microseconds
                                 %s - Response time sum
                                 %x - Response time squares sum
                                 %m - Minimum value
                                 %M - Maximum value
                                 %T - counts that package delay time(default 40ms)
                                 %h - Median value
                                 %S - Standard deviation
                                 %v - Variance (square stddev)
                                 %I - Iteration number
                                 %t - Timestamp since iteration zero
                                 %T - Unix timestamp
                                 %% - A literal %
                             Default is:
        "%T	%n	%M	%m	%a	%h	%S	%C	%95M	%95a	%95S	%99M	%99a	%99S
    ".
                             Statistics may contain a percentile between
                             the percentage sign and the code: %99n, %95a.
        --header[=<header>], --no-header
                             Whether to output a header. If not supplied, a
                             header is created out of the format. By default,
                             the header is shown.
        --interval <seconds>, -t
                             Output interval. Default is 10.
        --iterations <n>, -n
                             Output iterations. Default is 1, 0 is infinity
        --help               Shows program information and usage.
        --version            Shows version information.

    试用

    测试一个redis 服务的

    • 安装redis
    yum install -y redis
    • 运行命令
    ./tcprstat -p 6379 -t 1  -n 0
    • 运行压测
    redis-benchmark

    说明

    tcprstat 是一个很不错的工具,但是目前基本没看到维护了,实际上bcc是一个更好的性能分析套件,可以放到我们日常的开发以及性能
    分析的工具包中

    参考资料

    https://github.com/y123456yz/tcprstat
    https://github.com/Lowercases/tcprstat

  • 相关阅读:
    我决定重新开始搞机器学习啦
    基于问句实体扩展和全局规划的答案摘要方法研究相关论文
    cjson源代码解读(三) 解析字符串、数字、数组、对象
    论文阅读:DeepWalk
    cjson源代码解读 (二)解析流程
    cjson源代码解读 (一)介绍
    DDoS攻击的几种类型
    Nmap扫描二级目录
    一次域环境的渗透
    利用enum4linux 445端口+wordpress插件任意文件上传的一次渗透
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/13698791.html
Copyright © 2020-2023  润新知