对于nginx 操作工具 iftop 、ifstatus 、vegeta 的简单实践

brew update && brew install vegeta

#写target.txt文件内容如下:

GET https://www.baidu.com

#测试

vegeta attack -targets="test.log" -rate=100 -duration=30s > res.bin


# 分析请求时间

cat res.bin | vegeta report -type="hist[0,100ms,200ms,300ms]"


#图标分析

cat res.bin | vegeta plot > plot.html




--------------------------------------------------------

sudo systemctl restart ntpdate  同步时间

date 12100000

----------------------------------------------------------

ifstat和iftop是用来监测网络的工具。

ifstat

ifstat是个网络接口监测工具

mac安装ifstat方式

brew install ifstat

使用-a参数会打印回环接口

指定网络端口

使用-i参数


指定打印间隔时间

最后面加数字


每2秒打印一次,共打印3次



iftop

mac安装iftop方式

brew install iftop

在/usr/local/Cellar/iftop/下找到iftop的可执行文件,我的在/usr/local/Cellar/iftop/1.0pre4/sbin/iftop

将该文件软连接到/usr/local/bin目录下,ln -s /usr/local/Cellar/iftop/1.0pre4/sbin/iftop /usr/bin/local/iftop

执行时需要加上sudo

界面说明

TX:发送流量

RX:接收流量

TOTAL:总流量

Cumm:运行iftop到目前时间的总流量

peak:流量峰值

rates:分别表示过去 2s 10s 40s 的平均流量

相关参数

-i 设定监测的网卡,如:# iftop -i eth1

-B 以bytes为单位显示流量(默认是bits),如:# iftop -B

-n 使host信息默认直接都显示IP,如:# iftop -n

-N 使端口信息默认直接都显示端口号,如: # iftop -N

-F 显示特定网段的进出流量,如# iftop -F 10.10.1.0/24或# iftop -F 10.10.1.0/255.255.255.0

-h (display this message),帮助,显示参数信息

-p 使用这个参数后,中间的列表显示的本地主机信息,出现了本机以外的IP信息;

-b 使流量图形条默认就显示;

-f 过滤

-P 使host信息及端口信息默认就都显示;

-m 设置界面最上边的刻度的最大值,刻度分五个大段显示,例:# iftop -m 100M

​​

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容