跳转至

Apache ab压力测试工具


2015-06-16 by dongnan

举个栗子

模拟 1000并发 10000个请求

# 输入命令
ab -n 10000 -c 1000 http://10.0.100.212/op.php

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

Benchmarking 10.0.100.212 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests

Server Software:        Tengine
Server Hostname:        10.0.100.212
Server Port:            80

Document Path:          /op.php
Document Length:        5 bytes

Concurrency Level:      1000
Time taken for tests:   1.080 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      2260000 bytes
HTML transferred:       50000 bytes
Requests per second:    9260.45 [#/sec] (mean)
Time per request:       107.986 [ms] (mean)
Time per request:       0.108 [ms] (mean, across all concurrent requests)
Transfer rate:          2043.81 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   18 113.3      2    1000
Processing:     1   69 144.9     52    1039
Waiting:        1   64 145.4     48    1039
Total:         17   88 180.6     53    1056

Percentage of the requests served within a certain time (ms)
  50%     53
  66%     61
  75%     66
  80%     70
  90%     75
  95%     94
  98%   1040
  99%   1049
 100%   1056 (longest request)

命令帮助

ab -h
Usage: ab [options] [http[s]://]hostname[:port]/path
Options are:
-n requests     Number of requests to perform
-c concurrency  Number of multiple requests to make



回到页面顶部