Apache ab压力测试摘记

位置:首页>文章>详情   分类: 教程分享   阅读(1164)   2023-03-28 11:29:14

命令:

ab -n 800 -c 800  http://192.168.0.10/ 

说明:
(-n发出800个请求,-c模拟800并发,相当800人同时访问,后面是测试url)

命令:

ab -t 60 -c 100 http://192.168.0.10/ 

说明:
在60秒内发请求,一次100个请求。

命令:

ab -t 60 -c 100 -T "text/plain" -p p.txt http://192.168.0.10/hello.html 

说明:
如果需要在url中带参数
p.txt 是和ab.exe在一个目录 
p.txt 中可以写参数,如 p=wdp&fq=78

结果参数解释

This is ApacheBench, Version 2.3 <$Revision: 655654 $> 
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.0.10 (be patient) 
Completed 100 requests 
Completed 200 requests 
Completed 300 requests 
Completed 400 requests 
Completed 500 requests 
Completed 600 requests 
Completed 700 requests 
Completed 800 requests 
Finished 800 requests


Server Software:        Microsoft-HTTPAPI/2.0 
Server Hostname:        192.168.0.10 
Server Port:            80

Document Path:          / 
Document Length:        315 bytes       HTTP响应数据的正文长度

Concurrency Level:      800 
Time taken for tests:   0.914 seconds    所有这些请求处理完成所花费的时间 
Complete requests:      800             完成请求数 
Failed requests:        0                失败请求数 
Write errors:           0                
Non-2xx responses:      800 
Total transferred:      393600 bytes     网络总传输量 
HTML transferred:       252000 bytes     HTML内容传输量 
Requests per second:    875.22 [#/sec] (mean) 吞吐量-每秒请求数 
Time per request:       914.052 [ms] (mean)  服务器收到请求,响应页面要花费的时间 
Time per request:       1.143 [ms] (mean, across all concurrent requests) 并发的每个请求平均消耗时间 
Transfer rate:          420.52 [Kbytes/sec] received 平均每秒网络上的流量,可以帮助排除是否存在网络流量过大导致响应时间延长的问题


网络上消耗的时间的分解: 
Connection Times (ms) 
              min  mean[+/-sd] median   max 
Connect:        0    1   0.5      1       3 
Processing:   245  534 125.2    570     682 
Waiting:       11  386 189.1    409     669 
Total:        246  535 125.0    571     684

整个场景中所有请求的响应情况。在场景中每个请求都有一个响应时间 
其中 50% 的用户响应时间小于 571 毫秒 
80 % 的用户响应时间小于 652 毫秒 
最大的响应时间小于 684 毫秒 
Percentage of the requests served within a certain time (ms) 
  50%    571 
  66%    627 
  75%    646 
  80%    652 
  90%    666 
  95%    677 
  98%    681 
  99%    682 
100%    684 (longest request)
标签: ab 压力测试
地址:https://www.leftso.com/article/539.html

相关阅读

Apache ab压力测试摘记
apache ab 工具进行web压力测试
spring boot Junit单元测试_spring 普通项目单元测试
Nginx 限流组件limit_req limit_req作用: 限制用户(同一个ip)在给定时间内HTTP请求的数量, 流量限制主要用作安全目的, 可以防止大量请求的...
maven package打包项目跳过Junit测试
前言继续上一篇Spring Boot Redis 秒杀实现 的一个修改版本,主要实现用ab工具进行网页正式访问的一个版本,其主要目的还是介绍Redis实现秒杀活动的一种方式
一般spring框架与junit的整合测试都是通过注解@ContextConfiguration,配置其中的localtions加载的xml配置
Js也导出Excel,能在前台导出的话,将会大大减轻数据库的压力
spring boot 2.0 入门之单元测试多线程。spring boot 2.0 项目含多线程异步处理业务单元测试执行主线程结束不等待子线程结束。
测试数据 测试数据SQL: DROP TABLE IF EXISTS `student`; CREATE TABLE `student` ( `id` int(10) UNSIGNED ...