Apache HTTP Server 版本 2.4

ab 是一个用于测试 Apache 超文本传输协议 (HTTP) 服务器性能的工具。它旨在让您了解当前 Apache 安装的性能。特别是,它可以显示您的 Apache 安装每秒可以处理多少个请求。
ab [ -A auth-username:password ] [ -b windowsize ] [ -B local-address ] [ -c concurrency ] [ -C cookie-name=value ] [ -d ] [ -e csv-file ] [ -E client-certificate file ] [ -f protocol ] [ -g gnuplot-file ] [ -h ] [ -H custom-header ] [ -i ] [ -k ] [ -l ] [ -m HTTP-method ] [ -n requests ] [ -p POST-file ] [ -P proxy-auth-username:password ] [ -q ] [ -r ] [ -s timeout ] [ -S ] [ -t timelimit ] [ -T content-type ] [ -u PUT-file ] [ -v verbosity] [ -V ] [ -w ] [ -x <table>-attributes ] [ -X proxy[:port] ] [ -y <tr>-attributes ] [ -z <td>-attributes ] [ -Z ciphersuite ] [http[s]://]hostname[:port]/path
-A auth-username:password:) 分隔,并以 base64 编码发送。无论服务器是否需要此字符串(即,是否已发送 401 身份验证所需),都会发送此字符串。-b windowsize-B local-address-c concurrency-C cookie-name=valueCookie: 行。参数通常采用 name=value 对的形式。此字段可重复。-d-e csv-file-E client-certificate-file-f protocol-g gnuplot-file-h-H custom-header"Accept-Encoding: zip/zop;8bit")。-iHEAD 请求而不是 GET 请求。-k-l-m HTTP-method-n requests-p POST-file-T。-P proxy-auth-username:password:) 分隔,并以 base64 编码发送。无论代理是否需要此字符串(即,是否已发送 407 代理身份验证所需),都会发送此字符串。-qab 会每 10% 或 100 个请求左右在 stderr 上输出进度计数。-q 标志将抑制这些消息。-r-s timeout-S-t timelimit-n 50000。使用此选项在固定总时间内对服务器进行性能测试。默认情况下,没有时间限制。-T content-typeapplication/x-www-form-urlencoded。默认值为 text/plain。-u PUT-file-T。-v verbosity4 及以上打印有关标头的信息,3 及以上打印响应代码(404、200 等),2 及以上打印警告和信息。-V-w-x <table>-attributes<table> 属性的字符串。属性插入 <table here > 中。-X proxy[:port]-y <tr>-attributes<tr> 属性的字符串。-z <td>-attributes<td> 属性的字符串。-Z ciphersuite以下列表描述了 ab 返回的值
concurrency * timetaken * 1000 / done 计算,而第二个值使用公式 timetaken * 1000 / done 计算totalread / 1024 / timetaken 计算的传输速率存在各种固定长度的静态声明缓冲区。结合命令行参数、服务器的响应标头和其他外部输入的延迟解析,这可能会导致问题。
它没有完全实现 HTTP/1.x;只接受某些“预期”形式的响应。strstr(3) 的使用频率很高,在性能分析中排在首位,这可能表明存在性能问题;也就是说,您应该衡量 ab 的性能而不是服务器的性能。