首页 > 技术文章 > 并发与高并发(五)-并发模拟的三个工具

xusp 2019-11-12 22:14 原文

一、Postman

下载地址:http://www.onlinedown.net/soft/971602.htm

二、Apache Brench(AB)

下载地址:https://www.apachelounge.com/download/

用法:cd 到bin目录下,输入“ab -n 1000 -c 50 http://localhost:8080/test”

1000:执行数

50:允许最大并发数

http://localhost:8080/test:接口

三、Jmeter

下载地址:https://www.apache.org/dist/jmeter/binaries/

如果需要汉化:

打开apache-jmeter-5.0\bin\jmeter.properties 文件

修改第三十七行,去掉前面的#,

改为language=zh_CN

重新打开就是中文界面了

 

用法:cd 到bin目录下,输入“jmeter.bat”,如果是Linux用户,输入“sh jmeter.sh”。

1.出现以下界面,右击“Thread Group”->"Add"->"Threads(Users)"->"Thread Group"。

 

 

2.界面解释

3.右击“创建的线程组”->"Add"->"Sampler"->"HTTP-Request",添加HTTP请求。

 

4.HTTP请求界面解释,如图示例填写即可。(补充一下:Content encoding是编码,这里设置为“utf-8”,图中漏写了,自行补上)

 

5.添加监听器-图形结果,右击HTTP请求名称->“Add”->"Listener"->"Graph Results"。

 

6.添加监听器-图形结果树,右击HTTP请求名称->"Add"->"Listener"->"View Results Tree"。

 

 

7.点击运行,可以查看两个结果。

推荐阅读