网站首页 > 开源技术 正文
ab是apache自带的压力测试工具。ab命令会创建多个并发访问线程,模拟多个访问者同时对某一URL地址进行访问
// 安装(如果不安装apache但是又想使用ab命令,可以直接安装apache的工具包httpd-tools)
$ yum -y install httpd-tools
// 查看是否安装成功
$ ab -V
This is ApacheBench, Version 2.3 <$Revision: 1430300 gt;
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
// 常用参数
-n 执行的请求数量
-c 并发请求个数
// 示例
$ ab -n10 -c3 https://www.baidu.com
This is ApacheBench, Version 2.3 <$Revision: 1430300 gt;
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.baidu.com (be patient).....done
Server Software: BWS/1.1 // 服务器版本
Server Hostname: www.baidu.com // 服务器主机名
Server Port: 443 // 服务器端口
SSL/TLS Protocol: TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128
Document Path: / // 文件路径
Document Length: 227 bytes // 页面字节数
Concurrency Level: 3 // 并发数
Time taken for tests: 0.271 seconds // 总访问时间
Complete requests: 10 // 请求成功数量
Failed requests: 0 // 请求失败数量
Write errors: 0
Total transferred: 10820 bytes // 请求总数据大小(包括header头信息)
HTML transferred: 2270 bytes // HTML传输字节数
Requests per second: 36.86 [#/sec] (mean) // 每秒处理请求数,mean表示这是一个平均值
Time per request: 81.385 [ms] (mean) // 用户平均请求等待时间
Time per request: 27.128 [ms] (mean, across all concurrent requests) // 服务器平均处理时间
Transfer rate: 38.95 [Kbytes/sec] received // 传输速率
Connection Times (ms)
min mean[+/-sd] median max
Connect: 38 49 5.5 49 57
Processing: 13 16 1.7 16 19
Waiting: 13 16 1.7 16 19
Total: 51 65 7.0 65 76
Percentage of the requests served within a certain time (ms)
50% 65 // 50%用户请求在65ms内返回
66% 66
75% 66
80% 74
90% 76
95% 76
98% 76
99% 76 // %99用户请求在76ms内返回
100% 76 (longest request)
猜你喜欢
- 2024-12-08 OpenResty原理和介绍
- 2024-12-08 2023年是时候更新你的技术武器库了:Asgi vs Wsgi(FastAPI vs Flask)
- 2024-12-08 Java、Rust、Go、NodeJS、TypeScript并发编程比较
- 2024-12-08 某个应用的CPU使用率居然达到100%,我该怎么办?
- 2024-12-08 实战录 | mTCP用户态协议栈浅析
- 2024-12-08 网络基本概念和测试
- 2024-12-08 给你的Nginx加个防火墙
- 2024-12-08 spring赌上未来的一击:WebFlux性能实测
- 2024-12-08 Tomcat和Netty的战场:SpringMVC&WebFlux性能大比拼
- 2024-12-08 最近流行的APP性能测试方法
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- jdk (81)
- putty (66)
- rufus (78)
- 内网穿透 (89)
- okhttp (70)
- powertoys (74)
- windowsterminal (81)
- netcat (65)
- ghostscript (65)
- veracrypt (65)
- asp.netcore (70)
- wrk (67)
- aspose.words (80)
- itk (80)
- ajaxfileupload.js (66)
- sqlhelper (67)
- express.js (67)
- phpmailer (67)
- xjar (70)
- redisclient (78)
- wakeonlan (66)
- tinygo (85)
- startbbs (72)
- webftp (82)
- vsvim (79)
本文暂时没有评论,来添加一个吧(●'◡'●)