美文网首页
ABtest 性能测试

ABtest 性能测试

作者: xiaopang | 来源:发表于2016-08-05 10:37 被阅读565次

ABtest 性能测试

ab 模拟 get 性能测试:

-n 请求次数
-c 请求线程数
最后是路径

ab -n 100 -c 10 https://www.baidu.com

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/
m
Benchmarkinghttp://127.0.0.1:8002/webapi/ (be patient).....done

Server Software:        nginx/1.6.0
Server Hostname:        teststaff.91jinrong.com
Server Port:            443
SSL/TLS Protocol:       TLSv1/SSLv3,ECDHE-RSA-AES128-GCM-SHA256,2048,128

Document Path:          /api/permission_list?username=xueshi123&subsystem=WALLET
Document Length:        63136 bytes

Concurrency Level:      10
Time taken for tests:   69.852 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      6344900 bytes
HTML transferred:       6313600 bytes
Requests per second:    1.43 [#/sec] (mean)
Time per request:       6985.199 [ms] (mean)
Time per request:       698.520 [ms] (mean, across all concurrent requests)
Transfer rate:          88.70 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       24   59  45.7     40     267
Processing:   855 6721 1103.0   6807    8034
Waiting:      694 6418 966.7   6696    7196
Total:        898 6779 1111.2   6832    8125

Percentage of the requests served within a certain time (ms)
  50%   6832
  66%   7108
  75%   7608
  80%   7812
  90%   7950
  95%   8077
  98%   8124
  99%   8125
 100%   8125 (longest request)

  Concurrency Level: 并发级别

  Time taken for tests :测试消耗时间 seconds/秒
  Time taken for tests:    s

-----------------------------------------------------------------------------------------------------

ab test 模拟 post data 压测接口性能

ab

-n 请求次数
-c 请求线程数
-p 请求参数文件,文件格式: post_loc.txt
-T 请求数据类型 application/x-www-form-urlencoded 表单提交

cd /tmp
vim post_loc.txt

businessLine=qianbao&uname=714758616345&name=1jHFu3F6&cardId=A4tlZ8nWSY78niYa00iVGA6Q&gt18=true


发起测试接口

ab -p post_loc.txt  -T application/x-www-form-urlencoded   -H 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8' -H 'Accept: application/json'  -c 10 -n 100 http://127.0.0.1:8002/webapi/
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/

Benchmarkinghttp://127.0.0.1:8002/webapi/ (be patient).....done


Server Software:        nginx
Server Hostname:        http://127.0.0.1:8002/webapi/
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES256-GCM-SHA384,2048,256

Document Path:          http://127.0.0.1:8002/webapi/
Document Length:        100 bytes

Concurrency Level:      10
Time taken for tests:   1.218 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      43000 bytes
Total body sent:        35500
HTML transferred:       10000 bytes
Requests per second:    82.10 [#/sec] (mean)
Time per request:       121.797 [ms] (mean)
Time per request:       12.180 [ms] (mean, across all concurrent requests)
Transfer rate:          34.48 [Kbytes/sec] received
                        28.46 kb/s sent
                        62.94 kb/s total

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       55   82  13.7     82     119
Processing:    17   35  12.0     33      66
Waiting:       17   33  11.2     31      66
Total:         87  117  13.9    116     159

Percentage of the requests served within a certain time (ms)
  50%    116
  66%    121
  75%    126
  80%    128
  90%    137
  95%    143
  98%    148
  99%    159
 100%    159 (longest request)

-----------------------------------------------------------------------------------------------------

ab test 模拟 post json 压测接口性能

-n 请求次数
-c 请求线程数
-p 请求参数文件,文件格式: post_loc.txt
-T 请求数据类型 application/json json格式提交

ab -n 200 -c 10  -T 'application/json' -p post.json http://127.0.0.1:8002/webapi/

post.json

{
    "jsonrpc": "2.0",
    "method": "test_method",
    "params": [1442885518, 1442892718,"testDomain_80"],
    "id": "1"
}

相关文章

  • ABtest 性能测试

    ABtest 性能测试 ab 模拟 get 性能测试: -n 请求次数-c 请求线程数最后是路径 --...

  • 软件性能测试目录

    软件性能测试Ⅰ 软件性能测试Ⅱ 软件性能测试Ⅲ 软件性能测试Ⅳ 软件性能测试Ⅴ 软件性能测试Ⅵ 软件性能测试Ⅶ 软...

  • 性能测试概览目录

    性能测试概览Ⅰ 性能测试概览Ⅱ 性能测试概览Ⅲ 性能测试概览Ⅳ

  • 玩转电商应用性能调优

    第1章 入门篇—性能测试基础知识 什么性能测试 性能测试类型 性能测试基本流程 性能测试需求分析 性能测试指标

  • iOS 可值得深入研究方向

    ABtest 方案:如何提高客户端ABtest 方案的准确率? ABtest原理实现 瘦身策略:减小appsize...

  • 性能测试基础

    一.性能测试概况 性能测试是一个总称,具体可细分为性能测试、负载测试、压力测试、稳定性测试 性能测试: 以系统设计...

  • 测试类型划分

    功能测试 性能测试 性能测试主要包含以下方面: 性能测试指标 性能测试常用工具 安全测试 安全测试常用工具 安全测...

  • 性能测试常用的测试方法

    性能测试可分为七大类 如下: 第一、后端测试 后端性能测试,也就是服务器端性能测试。 后端性能测试,是通过性能测试...

  • 性能测试概览Ⅳ

    五类性能测试用例 ●预期指标的性能测试 ●并发用户的性能测试 ●疲劳强度和大数据量的性能测试 ●服务器性能测试 ●...

  • 系统测试

    系统测试 1、功能测试 测试维度 测试点考虑方向 2、性能测试 性能指标 性能考量方向 性能测试要点 多用户同时登...

网友评论

      本文标题: ABtest 性能测试

      本文链接:https://www.haomeiwen.com/subject/uoyhsttx.html