1.安装ab命令

写道
apt-get install apache2-utils

2.ab命令参数说明.

写道
Usage: ab [options] [http[s]://]hostname[:port]/path
Options are:

//总的请求数 
-n requests Number of requests to perform宅 

//一次同时并发的请求数 总的请求数(n)=次数*一次并发数(c) 

-c concurrency Number of multiple requests to make

-t timelimit Seconds to max. wait for responses
-b windowsize Size of TCP send/receive buffer, in bytes
-p postfile File containing data to POST. Remember also to set -T
-u putfile File containing data to PUT. Remember also to set -T
-T content-type Content-type header for POSTing, eg.
'application/x-www-form-urlencoded'
Default is 'text/plain'
-v verbosity How much troubleshooting info to print
-w Print out results in HTML tables
-i Use HEAD instead of GET
-x attributes String to insert as table attributes
-y attributes String to insert as tr attributes
-z attributes String to insert as td or th attributes
-C attribute Add cookie, eg. 'Apache=1234. (repeatable)
-H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip'
Inserted after all normal header lines. (repeatable)
-A attribute Add Basic WWW Authentication, the attributes
are a colon separated username and password.
-P attribute Add Basic Proxy Authentication, the attributes
are a colon separated username and password.
-X proxy:port Proxyserver and port number to use
-V Print version number and exit
-k Use HTTP KeepAlive feature
-d Do not show percentiles served table.
-S Do not show confidence estimators and warnings.
-g filename Output collected data to gnuplot format file.
-e filename Output CSV file with percentages served
-r Don't exit on socket receive errors.
-h Display usage information (this message)
-Z ciphersuite Specify SSL/TLS cipher suite (See openssl ciphers)
-f protocol Specify SSL/TLS protocol (SSL2, SSL3, TLS1, or ALL)

3.运行 ab -n 100 -c 10 http://hikin.iteye.com/

下面是对http://hikin.iteye.com/   进行着100次请求,10个请求同时并发 压力测试结果

写道
Server Software: lighttpd/1.4.20
Server Hostname: hikin.iteye.com
Server Port: 80

Document Path: /
Document Length: 2095 bytes

Concurrency Level: 10

//整个测试持续的时间 
Time taken for tests: 3.303 seconds

//完成的请求数量 
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 235200 bytes
HTML transferred: 209500 bytes

//平均每秒处理30个请求 
Requests per second: 30.27 [#/sec] (mean)

//平均每个请求处理时间为330毫秒 注:这里将一次10个并发请求看成一个整体 
Time per request: 330.335 [ms] (mean)

//平均每个并发请求处理 时间 为33毫秒 
Time per request: 33.034 [ms] (mean, across all concurrent requests)
Transfer rate: 69.53 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 51 170 35.9 178 230
Processing: 60 153 64.5 121 263
Waiting: 55 148 64.4 115 258
Total: 235 322 59.9 299 437

Percentage of the requests served within a certain time (ms)

//在这100个请求中有50%在299毫秒内完成 
50% 299

//在这100个请求中有66%在312毫秒内完成 
66% 312
75% 383
80% 412
90% 431
95% 432
98% 436
99% 437
100% 437 (longest request)

ubuntu中安装apache ab命令进行简单压力测试的更多相关文章

  1. Webbench、ab命令:做压力测试的工具和性能的监控工具

    DDOS攻击:???DDOS概述:分布式拒绝服务(DDoS:Distributed Denial of Service)攻击,指借助于客户/服务器技术,将多个计算机联合起来作为攻击平台,对一个或多个目 ...

  2. 如何使用 Apache ab 以及 OneAPM 进行压力测试?

    下一个 release 准备小长假后就要 go-live ,所有的测试 case 都 cover 过了,但还未进行过压力测试,有点不放心,刚好过节期间家人都回家去了,假期终于可以抽点时间压测一把. A ...

  3. 【开发者笔记】利用ab命令对接口进行压力测试

    目标:对接口进行正确性测试和压力测试 工具:Apache-ab 下载 系统:Windows.linux 目标接口:http://www.stagebo.xyz/foru/lifemonths 命令:a ...

  4. Docker Ubuntu中安装ping ifconfig命令

    Ubuntu 容器环境安装ping ifconfig 进入容器执行:ifconfig ping 没有该命令 apt-get update ###命令 ifconfig apt-get install ...

  5. 记录在Ubuntu 18.04系统中安装Apache, MySQL和PHP环境

    虽然我们在Linux VPS.服务器安装WEB环境比较方便,可以选择面板或者一键包,但是有些我们需要深入学习的网友不会选择一键安装,而是会尝试编译安装.这样可以学到一些内在的技术.一般我们较为习惯选择 ...

  6. Ubuntu中安装配置 JDK与apache

    一,前期准备: 1.下载apach网址:https://tomcat.apache.org/download-90.cgi 3.下载:jdk网址:http://www.oracle.com/techn ...

  7. 【转】在Ubuntu中安装HBase

    原博客出自于: http://blog.fens.me/category/%E6%95%B0%E6%8D%AE%E5%BA%93/ 感谢! Posted: Apr 3, 2014 Tags: Hado ...

  8. 在Ubuntu中安装Redis

    原文地址:http://blog.fens.me/linux-redis-install/ 在Ubuntu中安装Redis R利剑NoSQL系列文章,主要介绍通过R语言连接使用nosql数据库.涉及的 ...

  9. 如何在ubuntu中安装php

    如何在ubuntu中安装php 情衅 | 浏览 692 次 发布于2016-05-07 12:36   最佳答案   关于Ubuntu下的LAMP配置步骤: 首先要安装LAMP 就是Apache,PH ...

随机推荐

  1. 在scientificlinux7(centos7)中搭建apache+php本地服务器

    首先安装httpd(apache), 开始没有注意,以为可以这样安装 yum install apache 结果不对,搜索下 yum -qvh apache 命令是错的,在来 yum search a ...

  2. POJ 2482 Stars in Your Window(扫描线+线段树)

    [题目链接] http://poj.org/problem?id=2482 [题目大意] 给出一些点的二维坐标和权值,求用一个长H,宽W的矩形能框住的最大权值之和, 在矩形边缘的点不计算在内 [题解] ...

  3. 【最短路】【Heap-Dijkstra】【分层图】bzoj2662 [BeiJing wc2012]冻结

    裸的分层图最短路. #include<cstdio> #include<cstring> #include<queue> #include<algorithm ...

  4. mysql获取分类数量

    1.sql <select id="getTypeNum" resultType="TypeNum" > select count(*) as al ...

  5. ProgressDialog进度条对话框

    (一) 1.效果图: 2.activity_main.xml <?xml version="1.0" encoding="utf-8"?> < ...

  6. Swift中结合使用枚举与Switch

        定义:       用法:  

  7. PostgreSQL配置文件--连接和认证

    1 连接和认证 CONNECTIONS AND AUTHENTICATION 1.1 连接 CONNECTIONS 1.1.1 listen_addresses 字符型 默认: listen_addr ...

  8. git新建和删除远程分支

    创建远程分支: 新建本地分支 git checkout -b branch_name 推送到远程分支,分支名字和本地分支名字相同 git push origin branch_name:branch_ ...

  9. http://www.binghe.org/2010/03/use-httpsurlconnection-in-java/

    http://www.binghe.org/2010/03/use-httpsurlconnection-in-java/

  10. elasticsearch term 查询之一

    1.前言 term级别查询将按照存储在倒排索引中的确切字词进行操作,这些查询通常用于数字,日期和枚举等结构化数据,而不是全文本字段. 或者,它们允许您制作低级查询,并在分析过程之前进行. term级别 ...