Ubuntu16.04 ab安装以及使用教程

  1. 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

[email protected]:~/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)

时间: 2024-10-18 04:04:11

Ubuntu16.04 ab安装以及使用教程的相关文章

Ubuntu16.04 Caffe 安装步骤记录(超详尽)

"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Ubuntu16.04 Caffe 安装步骤记录(超详尽) - yhao的博客 - 博客频道 - CSDN.NET yhao的博客 最怕庸碌无为,还安慰自己平凡可贵 目录视图 摘要视图 订阅 [活动]2017 CSDN博客专栏评选 &nbsp [5月书讯]流畅的Pyt

ubuntu16.04 ,安装最新版本docker

环境:ubuntu16.04 ,安装最新版本docker 1.  添加GPG key: sudo apt-key adv--keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys58118E89F3A912897C070ADBF76221572C52609D 2. 添加源 新建文件:/etc/apt/sources.list.d/docker.list, 在里面添加内容: debhttps://apt.dockerproject.or

在ubuntu16.04上安装有道词典

参考来源:http://www.cnblogs.com/scplee/archive/2016/05/13/5489024.html 在ubuntu16.04上安装有道词典主要是解决依赖问题,我们在配置文件中把依赖文件删除,就行了 第一步:下载有道词典的.deb包 第二步:创建youdao文件,然后把有道的源文件解压到这个包里 sudo dpkg -X sudo dpkg -X ./youdao-dict_1.1.0-0-ubuntu_amd64.deb youdao 第二步:解压deb包中的c

VMware下Ubuntu16.04的安装、可能出现的问题的解决办法及基本配置

安装VMware 1.下载VMware Workstation Pro 12.1.0 for Windows,安装. 2.VMware永久证书秘钥:5A02H-AU243-TZJ49-GTC7K-3C61N 添加新磁盘分区 1.磁盘管理 -> 选择剩余空间较大的磁盘(D) -> 压缩卷(40960M ≈ 39.9G,最好大于20G) 2.新建简单卷 -> 更改盘符(E, up2u)和名称(Ubuntu,up2u) 创建虚拟机 1.创建虚拟机 -> 自定义(高级) 2.稍后安装操作系

分布式进阶(二)Ubuntu 14.04下安装Dockr图文教程(一)

当前,完全硬件虚拟化技术(KVM.Xen.Hyper-V 等)能在一个物理主机上很好地运行多个互相独立的操作系统,但这也带来一些问题:性能不佳,资源浪费,系统反应迟缓等.有时候对用户来说,完全的硬件虚拟化并不是最好的选择. 一种替代方案是使用轻量级虚拟化技术 -- 所谓的 LinuX Container 容器 (LXC),它提供的是系统级虚拟化.与跑虚拟机相比,LXC 可以在一个轻量级沙箱容器里面跑多个 Linux 操作系统.当你需要设置一些易于克隆的开发环境.测试环境,或想在安全沙盒里安装应用

ubuntu16.04 lts 安装freeswitch

ubuntu16.04 lts 安装freeswitch: 0.安装一堆依赖包. 1.使用root权限  su root , FSfile=$(curl -s https://files.freeswitch.org/releases/freeswitch/ | sed -n 's/.*"\(freeswitch\-[0-9]*\.[0-9]*\.[0-9]*\.tar\.gz\)".*/\1 /p' | tail -n 1) && echo Downloading $

ubuntu16.04 python3 安装selenium及环境配置

环境 ubuntu16.04 python3 安装selenium sudo pip3 install seleium 默认安装完是支持firefox,但是更新得太慢对于较新的firefox已经不支持了,需要安装geckodriver,地址 https://github.com/mozilla/geckodriver/releases/ 下载完后解压然后在终端中cd到下载文件路径下,下面以路径为下载为例 依次执行以下命令: 安装xvfb sudo apt-get install xvfb 安装p

Ubuntu16.04下安装redis

Ubuntu16.04下安装redis 保证网络畅通,选定好下载工作路径,执行以下命令下载redis-3.2.6: sudo wget http://download.redis.io/releases/redis-3.2.6.tar.gz  解压该文件: sudo tar -zxvf redis-3.2.6.tar.gz 会在当前目录下生成文件夹redis-3.2.6,我把它移动到了/usr/redis目录下: sudo mv redis-3.2.6 /usr/redis 如果没有安装gcc,

Ubuntu16.04下安装oracle客户端

在Ubuntu16.04下安装oracle数据库客户端,使Django项目连接到Oracle数据库 1.下载oracle客户端安装包: 进入官网http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html下载如下所需的三个包. oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm oracle-instantclient11.2-devel-11.2.0.4.0-1