Apache ab压力测试摘记

编程教程 (2242) 2025-01-27 10:13:24

命令:

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)

评论
User Image
提示:请评论与当前内容相关的回复,广告、推广或无关内容将被删除。

相关文章
命令:ab -n 800 -c 800 http://192.168.0.10/ 说明:(-n发出800个请求,-c模拟800并发,相当800人同时访问,后面是
命令:#ab -r -n 1000 -c 100 -k http://www.your.com/#ab -r -t 600 -c 1000 -k http://
Apache Shiro教程,您的第一个Apache Shiro应用程序(翻译)-编程技术
1.通过yum安装Apache(安装版本为:2.4.6)2.查看默认的工作模式[root@VM_26_67_centos ~]# httpd -VAH00558
Java 10上的Apache CXF
spring boot Junit单元测试_spring 普通项目单元测试
一般spring框架与junit的整合测试都是通过注解@ContextConfiguration,配置其中的localtions加载的xml配置
Spring Boot 2.0 支持的Apache Camel 版本发布了_Apache Camel 2.22发布支持Spring Boot 2.0
maven package打包项目跳过Junit测试&lt;build&gtl; &lt;plugins&gtl; &lt;plugin&gtl; &lt;groupId&gtl;org.apa...
java编程中采用Apache common.httpclient方式模拟POST请求
java使用apache.commons.net.ftp工具实现FTP文件上传下载import java.io.BufferedInputStream;impo
前言继续上一篇Spring Boot Redis 秒杀实现 的一个修改版本,主要实现用ab工具进行网页正式访问的一个版本,其主要目的还是介绍Redis实现秒杀活动的一种方式
Js也导出Excel,能在前台导出的话,将会大大减轻数据库的压力
组态,将Shiro集成到任何Web应用程序中的最简单的方法是在web.xml中配置Servlet ContextListener和Filter,了解如何读取Shiro的INI配置。
Nginx 限流组件limit_req limit_req作用: 限制用户(同一个ip)在给定时间内HTTP请求的数量, 流量限制主要用作安全目的, 可以防止大量请求的...