1最近刚开始接触apache大数据下数据优化,讲一下apache 下ab压力测试工具。

程序“ab”尚未安装。 您可以使用以下命令安装:

apt-get install apache2-utils   

以下是ab --help

sage: ab [options] [http[s]://]hostname[:port]/path
Options are:
-n requests Number of requests to perform
-c concurrency Number of multiple requests to make at a time
-t timelimit Seconds to max. to spend on benchmarking
This implies -n
-s timeout Seconds to max. wait for each response
Default is seconds
-b windowsize Size of TCP send/receive buffer, in bytes
-B address Address to bind to when making outgoing connections
-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 to use for POST/PUT data, 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.
-q Do not show progress when doing more than requests
-l Accept variable document length (use this for dynamic pages)
-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
(SSL3, TLS1, TLS1., TLS1. or ALL)
-n :总共的请求执行数,缺省是1;
-c: 并发数,缺省是1;
-t:测试所进行的总时间,秒为单位,缺省50000s
-p:POST时的数据文件
-w: 以HTML表的格式输出结果  

以下为执行    ab -n 5000 -c 200 http://localhost/test.php   的结果:

Benchmarking localhost (be patient)
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Finished requests //执行完的请求次数

Server Software: Apache/2.4.3 //apache版本
Server Hostname: localhost //主机
Server Port: 80 //端口 Document Path: /test.php //路径
Document Length: bytes Concurrency Level:
Time taken for tests: 3.927 seconds //完成此次请求时间
Complete requests: 5000 //完成请求次数
Failed requests: 527 //失败的请求次数
(Connect: , Receive: , Length: , Exceptions: )
Total transferred: bytes //总共传输字节
HTML transferred: bytes
Requests per second: 1273.33 [#/sec] (mean) //每秒请求次数
Time per request: 157.069 [ms] (mean) //一次请求时间
Time per request: 0.785 [ms] (mean, across all concurrent requests)
Transfer rate: 77914.14 [Kbytes/sec] received //传输速率 Connection Times (ms)
min mean[+/-sd] median max
Connect: 73.1
Processing: 143.9
Waiting: 135.3
Total: 160.3 Percentage of the requests served within a certain time (ms)
%
%
%
%
%
%
%
%
% (longest request)

ubuntu下 使用AB做压力测试的更多相关文章

  1. Linux学习13-CentOS安装ab做压力测试

    前言 网站性能压力测试是服务器网站性能调优过程中必不可缺少的一,测试环境准备好了后,如何对网站做压力测试? 压力测试的工具很多,如:ab.http_load.webbench.siege.jmeter ...

  2. ab做压力测试

    ab是apache 自带的一个压力测试的小工具,可用于接口简单的压力测试. 以下是AB的简要介绍 格式:ab [options] [http://]hostname[:port]/path 参数说明: ...

  3. centos8平台使用ab做压力测试

    一,安装ab [root@blog ~]# yum install httpd-tools 说明:刘宏缔的架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/archi ...

  4. ubuntu下用webbench做网站压力测试

    安装依赖 exuberant-ctags sudo apt-get install exuberant-ctags 下载源码并安装 wget http://blog.s135.com/soft/lin ...

  5. 使用Apache Benchmark做压力测试遇上的5个常见问题

    这一篇文章主要记录我在使用Apache Benchmark(一下检测ab)做网站压力测试的过程中,遇到的一些问题以及解决办法,方便日后使用. 这一篇文章主要记录我在使用Apache Benchmark ...

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

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

  7. 在linux中给你的应用做压力测试

    在linux中给你的应用做压力测试 作者: 立地 邮箱: jarvin_g@126.com QQ: 511363759 一.webbench 1.在Ubuntu中安装webbench —支持get,h ...

  8. (转)学习使用Jmeter做压力测试(三)--数据库测试

    数据库测试 JMeter可以做为Web服务器与浏览器之间的代理网关,以捕获浏览器的请求和Web服务器的响应,这样就可很容易的生成性能测试脚本. 根据脚本,JMeter可通过线程组来模拟真实用户对Web ...

  9. 使用JMeter做压力测试

    使用JMeter做压力测试 1.下载Jmeter 地址:http://jmeter.apache.org/download_jmeter.cgi 2.启动jmeter 运行bin/jmeter.bat ...

随机推荐

  1. 多线程 Worker Thread 模式

    Worker是“工人”的意思,worker thread pattern中,工人线程(worker thread)会一次抓一件工作来处理,当没有工作可做时,工人线程会停下来等待心得工作过来. Work ...

  2. Delphi自定义消息应用及delphi托盘实现

    Delphi自定义消息应用及delphi托盘实现interfaceuses   Windows, Messages, SysUtils, Variants, Classes, Graphics, Co ...

  3. DateTime用法

    //今天 DateTime.Now.Date.ToShortDateString(); //昨天,也就是今天的日期减一 DateTime.Now.AddDays(-1).ToShortDateStri ...

  4. Java-单机版的书店管理系统(练习设计模块和思想_系列汇总)

    介绍: 本软件系列到此,我已经全部写完了. 项目练习目标 : 1.Java应用程序基本分析 2.培养面向对象编程的基本思想 3.Java基本设计模式综合应用 4.掌握分层和接口的基本设计 5.构建合理 ...

  5. AES - Rijndael 算法(一)

    1997年1月,美国标准技术协会NIST开始遴选数据加密标准(Data Encryption Standard,简称DES)替代者的工作,称为高级加密标准[1’2](Advanced Enerypti ...

  6. mysql binaryVInstall

    下载mysql 1.下载:在http://dev.mysql.com/downloads/mysql/官网上下载mysql-5.5.28-linux2.6-i686.tar.gz. 2.解压 -lin ...

  7. 辛巴达:帮电商打造ZARA式开放供应链体系 - 行业网站 - 亿邦动力网

    辛巴达:帮电商打造ZARA式开放供应链体系 - 行业网站 - 亿邦动力网 辛巴达:帮电商打造ZARA式开放供应链体系

  8. 【iOS与EV3混合机器人编程一系列五个】iOS_WiFi_EV3_Library 解剖连接EV3

    在上一篇文章中.我们解说了怎样用开源码库CocoaAsyncSocket来实现iOS上的UDP和TCP数据通信.那么在本文中.我们将介绍在CocoaAsyncSocket的基础怎样使用UDP和TCP连 ...

  9. Swift开发语法

    Swift开发入门 简介 Swift 语言由苹果公司在 2014 年推出,用来撰写 OS X 和 iOS 应用程序 2014 年,在 Apple WWDC 发布 历史 2010 年 7 月,苹果开发者 ...

  10. ASSERT_VALID和ASSERT宏分析

    这个宏都是MFC的调试宏. ASSERT_VALID宏用来在运行时检查一个对象的内部合法性,比如说现在有一个学生对象,我们知道每个学生的年龄一定大于零,若年龄小于零,则该学生对象肯定有问题. 事实上, ...