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. UVA 699 The Falling Leaves (递归先序建立二叉树)

    题目链接:http://acm.hust.edu.cn/vjudge/problem/19244 #include <iostream> #include <cstdio> # ...

  2. 22、Django实战第22天:课程评论

    1.编辑course-comment.html 2.编辑courses.views.py class CourseCommentView(LoginRequiredMixin, View): def ...

  3. c++ primer敲代码第二章

    今天越来越发现 学习一门编程语言,没有大量的code实践是不行的.看得快忘得更快.痛下决心,把primer的code习题一一实现. 习题2.11 底数和指数,求结果 #include <iost ...

  4. luogu P1291 [SHOI2002]百事世界杯之旅

    题目链接 luogu P1291 [SHOI2002]百事世界杯之旅 题解 设\(f[k]\)表示还有\(k\)个球员没有收集到的概率 再买一瓶,买到的概率是\(k/n\),买不到的概率是\((n-k ...

  5. 生成随机位数的UUID

    1,生成UUID package com.jeeplus.common.utils; import java.util.UUID; /** * 生成唯一的UUID * * @author songya ...

  6. display:block什么时候使用

    所有的块级元素不需要再在使用display:block定义,块级元素本身的默认属性就是block display:block:比较常用于<a><span>这两个标签,因为他们不 ...

  7. 解决sqlite删除数据后,文件大小不变问题 转载

    原文地址:http://blog.csdn.net/yangchun1213/article/details/7656146   说了这么多,没进主题,我的主题是给Sqlite在删除数据后擦屁股. 大 ...

  8. 并发的HashMap为什么会引起死循环?(转)

    本文转自http://blog.csdn.net/zhuqiuhui/article/details/51849692 今天研读Java并发容器和框架时,看到为什么要使用ConcurrentHashM ...

  9. 【转】谈基于SOA的应用系统设计和开发

    注:在网上看到这篇文档,觉得写得很好,清晰实用.该博客其它文章也写得不错     地址:http://blog.sina.com.cn/s/blog_493a84550101gswn.html 现在对 ...

  10. NET PROVIDER 连接 Oracle数据库

    NET 数据库连接 ORacle      http://www.devart.com/ DataDirect   http://www.datadirect.com/ Oracle免客户端For . ...