Ubuntu16.04 ab安装以及使用教程
2017-03-10 14:26
417 查看
sudo apt-get install apache2-utils
安装ab
2.ab -n 10000 -c 100 https://www.baidu.com/
压力测试www.baidu.com的http访问性能
-n 10000 总共请求数10000
-c 100个并发线程同时访问
性能测试报告如下:
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
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)
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: bfe/1.0.8.18
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: 100
Time taken for tests: 30.201 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 10326740 bytes
HTML transferred: 2270000 bytes
Requests per second: 331.12 [#/sec] (mean)
Time per request: 302.008 [ms] (mean)
Time per request: 3.020 [ms] (mean, across all concurrent requests)
Transfer rate: 333.92 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 20 255 626.4 33 15054
Processing: 7 33 82.0 10 1897
Waiting: 0 32 81.6 10 1895
Total: 27 288 635.1 50 15272
Percentage of the requests served within a certain time (ms)
50% 50
66% 241
75% 257
80% 293
90% 1027
95% 1056
98% 2030
99% 2060
100% 15272 (longest request)
3.测试某个POST请求性能
ab -n 10000 -c 100 -p postfile -m POST localhost:8080/DealerProxySrv/DealerProxySrv/RHPCFollow
-n 10000 总共请求数10000
-c 100个并发线程同时请求
-p postfile
root@ubuntu:~/code# cat postfile
{
"TraderId": "200030258",
"TBrokerId": 1,
"CustomerId": "200027977",
"CBrokerId": 1,
"Strategy": 1,
"Size": 1,
"Direction": 1
}
-m POST,method为POST
性能测试报告如下:
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (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:
Server Hostname: localhost
Server Port: 8080
Document Path: /DealerProxySrv/DealerProxySrv/RHPCFollow
Document Length: 113 bytes
Concurrency Level: 100
Time taken for tests: 122.149 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 2450000 bytes
Total body sent: 3270000
HTML transferred: 1130000 bytes
Requests per second: 81.87 [#/sec] (mean)
Time per request: 1221.487 [ms] (mean)
Time per request: 12.215 [ms] (mean, across all concurrent requests)
Transfer rate: 19.59 [Kbytes/sec] received
26.14 kb/s sent
45.73 kb/s total
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.8 0 26
Processing: 46 1216 184.4 1206 2428
Waiting: 46 1216 184.4 1206 2428
Total: 52 1216 184.2 1206 2428
Percentage of the requests served within a certain time (ms)
50% 1206
66% 1261
75% 1300
80% 1323
90% 1391
95% 1457
98% 1599
99% 1995
100% 2428 (longest request)
安装ab
2.ab -n 10000 -c 100 https://www.baidu.com/
压力测试www.baidu.com的http访问性能
-n 10000 总共请求数10000
-c 100个并发线程同时访问
性能测试报告如下:
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
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)
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: bfe/1.0.8.18
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: 100
Time taken for tests: 30.201 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 10326740 bytes
HTML transferred: 2270000 bytes
Requests per second: 331.12 [#/sec] (mean)
Time per request: 302.008 [ms] (mean)
Time per request: 3.020 [ms] (mean, across all concurrent requests)
Transfer rate: 333.92 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 20 255 626.4 33 15054
Processing: 7 33 82.0 10 1897
Waiting: 0 32 81.6 10 1895
Total: 27 288 635.1 50 15272
Percentage of the requests served within a certain time (ms)
50% 50
66% 241
75% 257
80% 293
90% 1027
95% 1056
98% 2030
99% 2060
100% 15272 (longest request)
3.测试某个POST请求性能
ab -n 10000 -c 100 -p postfile -m POST localhost:8080/DealerProxySrv/DealerProxySrv/RHPCFollow
-n 10000 总共请求数10000
-c 100个并发线程同时请求
-p postfile
root@ubuntu:~/code# cat postfile
{
"TraderId": "200030258",
"TBrokerId": 1,
"CustomerId": "200027977",
"CBrokerId": 1,
"Strategy": 1,
"Size": 1,
"Direction": 1
}
-m POST,method为POST
性能测试报告如下:
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (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:
Server Hostname: localhost
Server Port: 8080
Document Path: /DealerProxySrv/DealerProxySrv/RHPCFollow
Document Length: 113 bytes
Concurrency Level: 100
Time taken for tests: 122.149 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 2450000 bytes
Total body sent: 3270000
HTML transferred: 1130000 bytes
Requests per second: 81.87 [#/sec] (mean)
Time per request: 1221.487 [ms] (mean)
Time per request: 12.215 [ms] (mean, across all concurrent requests)
Transfer rate: 19.59 [Kbytes/sec] received
26.14 kb/s sent
45.73 kb/s total
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.8 0 26
Processing: 46 1216 184.4 1206 2428
Waiting: 46 1216 184.4 1206 2428
Total: 52 1216 184.2 1206 2428
Percentage of the requests served within a certain time (ms)
50% 1206
66% 1261
75% 1300
80% 1323
90% 1391
95% 1457
98% 1599
99% 1995
100% 2428 (longest request)
相关文章推荐
- 在Ubuntu 16.04安装与使用Docker的教程详解
- ubuntu16.04下安装MATLAB2016b 教程以及启动matbal
- 使用U盘安装ubuntu 16.04简易教程
- Ubuntu16.04安装配置Eclipse 以及opencv的使用
- vitual box 及 ubuntu 安装及使用教程以及常见error
- Ubuntu16.04下安装Anaconda3过程python3.6使用,以及重新建立新的Python2.7并安装tensorflow-gpu,测试并成功。
- Linux系统使用--ubuntu 16.04安装与下载KDE(kubuntu-desktop)以及相关并发意外状况的处理
- Ubuntu 16.04 apt终端命令的使用以及软件的安装和卸载
- ubuntu16.04安装pycharm生成快捷方式以及命令使用说明
- Ubuntu 16.04安装使用Docker教程
- 物联网仿真 ns-allinone-2.35 安装教程 ubuntu16.04下安装 与使用
- Ubuntu 16.04 安装使用MySQL以及安装mysql-workbench,ubuntu16.04设置禁止mysql开机自启动
- ubuntu16.04 编译安装mysql5.7.x,以及配置使用
- 在Ubuntu中怎样使用校园网上网,以及安装mentohust教程
- ubuntu16.04安装pycharm以及使用说明
- ubuntu10.04编译安装LAMP以及简单wordpress的使用
- Ubuntu server 11.04 安装memcache 以及使用memcache 来存储 session
- Ubuntu操作系统安装使用教程
- Ubuntu 用户安装文件较器meld使用,以及添加进右键菜单
- Ubuntu中SVN客户端安装以及使用(12.04最新版本)