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. MySQL逻辑架构简介

    1.Connectors指的是不同语言中与SQL的交互2 Management Serveices & Utilities: 系统管理和控制工具3 Connection Pool: 连接池管理 ...

  2. 贮油点问题(C++)

    贮油点问题…..一道送命系列的递推… 描述 Description 一辆重型卡车欲穿过S公里的沙漠,卡车耗汽油为1升/公里,卡车总载油能力为W公升.显然卡车装一次油是过不了沙漠的.因此司机必须设法在沿 ...

  3. RabbitMQ (一) 简介和基本概念

    原文:https://blog.csdn.net/vbirdbest/article/details/78577043 一.简介 MQ全称为Message Queue, 消息队列(MQ)是一种应用程序 ...

  4. [BZOJ 1177] Oil

    Link:https://www.lydsy.com/JudgeOnline/problem.php?id=1177 Solution: 相当于将大矩形分为3块,取每块中最大的正方形 对于此类分成几块 ...

  5. 【线段树】bzoj3038 上帝造题的七分钟2 / bzoj3211 花神游历各国

    暴力修改,记录一段是否全部为1或0,若全是了,则不再修改. 注意3211一定要判是否为0,否则会T得惨无人道. #include<cstdio> #include<cmath> ...

  6. [CSAcademy]Connected Tree Subgraphs

    题目大意: 给你一棵n个结点的树,求有多少种染色方案,使得染色过程中染过色的结点始终连成一块. 思路: 树形DP. 设f[x]表示先放x时,x的子树中的染色方案数,y为x的子结点. 则f[x]=pro ...

  7. 十. 图形界面(GUI)设计9.列表和组合框

    列表和组合框是又一类供用户选择的界面组件,用于在一组选择项目选择,组合框还可以输入新的选择. 列表 列表(JList)在界面中表现为列表框,是JList类或它的子类的对象.程序可以在列表框中加入多个文 ...

  8. 使用MultipleInputs和MultipleOutputs

    还是计算矩阵的乘积,待计算的表达式如下: S=F*[B+mu(u+s+b+d)] 其中,矩阵B.u.s.d分别存放在名称对应的SequenceFile文件中. 1)我们想分别读取这些文件(放在不同的文 ...

  9. golang的reflect

    引用自 http://www.jb51.net/article/115002.htm 和 C 数据结构一样,Go 对象头部并没有类型指针,通过其自身是无法在运行期获知任何类型相关信息的.反射操作所需要 ...

  10. WPF在代码中创建DataTemplate时候的异常

    今天写段程序用到了在代码中手动创建DataTemplate, var factory = new FrameworkElementFactory(typeof(OperationColumn));   ...