zoukankan      html  css  js  c++  java
  • 压力测试Apache

    在做类似商城秒杀系统的同事都知道要在支持高并发,高可用的环境下进行多次的压力测试来防止自己的项目结构被高额的点击量击穿,导致商品超卖等损失

    介绍一款简单的软件 xampp   

    xam里带了Apache服务器   

    Apache服务器自带有一个叫AB(ApacheBench)的工具,可以对服务器进行负载测试

    装xampp软件

    进入 c:/xampp/apache/bin

    基本用法:

    ab  -n 全部请求数 -c 并发数测试url

    注:可以将ab.exe 加入系统环境变量;或直接切换置 ab 目录执行。如: C:WindowsSystem32> cd C:xamppapachein

      

    更多参数:

    -n  requests     全部请求数

    -c  concurrency  并发数

    -t  timelimit     最传等待回应时间

    -p  postfile      POST数据文件

    -T  content-type  POST Content-type

    -v  verbosity     Howmuch troubleshooting info to print

    -w              Print outresults 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    加入cookie, eg.'Apache=1234. (repeatable)

    -H  attribute    加入http, eg.'Accept-Encoding: gzip'

                    Inserted after all normalheader lines. (repeatable)

    -A  attribute    http验证,分隔传递用户名及密码

    -P  attribute    Add Basic Proxy Authentication, theattributes

                    are a colon separated usernameand password.

    -X  proxy:port   代理服务器

    -V              查看ab版本

    -k              Use HTTPKeepAlive feature

    -d              Do not showpercentiles served table.

    -S              Do not showconfidence estimators and warnings.

    -g  filename     Output collected data to gnuplot formatfile.

    -e  filename     Output CSV file with percentages served

    -h              Display usageinformation (this message)

  • 相关阅读:
    P4396 [AHOI2013]作业 分块+莫队
    B1965 [Ahoi2005]SHUFFLE 洗牌 数论
    B1970 [Ahoi2005]Code 矿藏编码 暴力模拟
    B1968 [Ahoi2005]COMMON 约数研究 数论
    B1237 [SCOI2008]配对 贪心 + dp
    B1108 [POI2007]天然气管道Gaz 贪心
    B1734 [Usaco2005 feb]Aggressive cows 愤怒的牛 二分答案
    B1012 [JSOI2008]最大数maxnumber 分块||RMQ
    HAOI2007 反素数
    NOIP2009 Hankson的趣味题
  • 原文地址:https://www.cnblogs.com/wjohh/p/10692739.html
Copyright © 2011-2022 走看看