search
Homephp教程php手册PHP 使用Apache 中的ab 测试网站的压力性能


  打开Apache服务器的安装路径(我用的是 WampServer),在bin目录中有一个ab.exe的可执行程序,它就是要介绍的压力测试工具。



  在Windows系统的命令行下,进入ab.exe程序所在目录,执行ab.exe程序。注意直接双击无法正确运行。喎?http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcD4KPHA+ICAgICAgICBkOii72LO1L734yOtExcwpPGJyPgo8L3A+CjxwPiA8aW1nIHNyYz0="http://www.2cto.com/uploadfile/Collfiles/20140614/20140614091704240.jpg" alt="\">


  

  cd wamp\bin\apache\Apache2.4.4\bin(回车/进入 bin目录)


 

  ab(回车/)

  如果看到下列一些帮助信息就说明成功启动ab



  开始启动ab 压力测试

  ab -n 5000 -c 200 http://localhost/test.php

  上例表示总共访问http://localhost/test.php这个脚本5000次,200并发(模拟200个用户同时访问)。

  ab常用参数的介绍:

  -n :总共的请求执行数,缺省是1;

  -c: 并发数,缺省是1;

  -t:测试所进行的总时间,秒为单位,缺省50000s

  -p:POST时的数据文件

  -w: 以HTML表的格式输出结果



Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment