ubuntu,centor 安装apache bench

ab全称为:apache bench。

是apache自带的压力测试工具。ab非常实用,它不仅可以对apache服务器进行网站访问压力测试,也可以对或其它类型的服务器进行压力测试。比如nginx、tomcat、IIS等。

 

    ubuntu 安装:

    sudo apt-get install apache2-utils



centos 安装:
yum install apr-util

# 安装依赖 yum-utils中的yumdownload 工具
# 如果没有找到 yumdownload 命令可以
yum install yum-utils



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
zhubin@zhubin:/$ ab -n 1000 -c 100 http://local.wo.com/api.com/Index/getBanner
This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
 
Benchmarking local.wo.com (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
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
 
 
Server Software:        nginx
Server Hostname:        local.wo.com
Server Port:            80
 
Document Path:          /api.com/Index/getBanner
Document Length:        162 bytes
 
Concurrency Level:      100
Time taken for tests:   0.074 seconds
Complete requests:      1000
Failed requests:        0
Non-2xx responses:      1000
Total transferred:      305000 bytes
HTML transferred:       162000 bytes
Requests per second:    13576.44 [#/sec] (mean)
Time per request:       7.366 [ms] (mean)
Time per request:       0.074 [ms] (mean, across all concurrent requests)
Transfer rate:          4043.76 [Kbytes/sec] received
 
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        1    3   0.6      3       5
Processing:     1    4   1.1      4       8
Waiting:        1    3   1.1      3       8
Total:          4    7   0.8      7      10
 
Percentage of the requests served within a certain time (ms)
  50%      7
  66%      7
  75%      7
  80%      7
  90%      8
  95%      8
  98%      9
  99%     10
 100%     10 (longest request)

  




posted @   盘思动  阅读(519)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
点击右上角即可分享
微信分享提示