- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 ApacheBench 进行一些负载测试。我希望 ab 使用我 Mac 上/etc/hosts 中指定的 IP 地址解析主机名。我怎么能强制它? curl 有一个 --resolve 选项可以做到这一点,正如指定的 here .我正在为 ab 寻找类似的东西。
最佳答案
反过来想一想:你可以告诉 Curl 命中一个 IP 地址,并指定 Host
header 来触发所需的域。
curl example.com
curl --header "Host: example.com" 93.184.216.34
ab
使用
-H
标志,因此
ab -n 10 -c 10 http://example.com/
ab -n 10 -c 10 -H "Host: example.com" http://93.184.216.34/
http
与
https
)并达到正确的 FQD。也就是说,如果你的网站响应
www.example.com
但不是
example.com
(没有
www
)一定要使用有效的。
ab
反对
yahoo.com
(我不建议这样做)不会是一个好的测试,因为
yahoo.com
立即重定向到
www.yahoo.com
如果您
curl
可以看到它处于详细模式:
# curl yahoo.com
redirect
# curl yahoo.com -v
* About to connect() to yahoo.com port 80 (#0)
* Trying 98.139.180.180...
* Connected to yahoo.com (98.139.180.180) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: yahoo.com
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Wed, 07 Mar 2018 13:46:53 GMT
< Connection: keep-alive
< Via: http/1.1 media-router-fp29.prod.media.bf1.yahoo.com (ApacheTrafficServer [c s f ])
< Server: ATS
< Cache-Control: no-store, no-cache
< Content-Type: text/html
< Content-Language: en
< X-Frame-Options: SAMEORIGIN
< Strict-Transport-Security: max-age=2592000
< Location: https://www.yahoo.com/
< Content-Length: 8
<
* Connection #0 to host yahoo.com left intact
redirect
# curl --header "Host: yahoo.com" 98.139.180.180 -v
* About to connect() to 98.139.180.180 port 80 (#0)
* Trying 98.139.180.180...
* Connected to 98.139.180.180 (98.139.180.180) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Accept: */*
> Host: yahoo.com
>
< HTTP/1.1 301 Moved Permanently
< Date: Wed, 07 Mar 2018 13:51:26 GMT
< Connection: keep-alive
< Via: http/1.1 media-router-fp82.prod.media.bf1.yahoo.com (ApacheTrafficServer [c s f ])
< Server: ATS
< Cache-Control: no-store, no-cache
< Content-Type: text/html
< Content-Language: en
< X-Frame-Options: SAMEORIGIN
< Strict-Transport-Security: max-age=2592000
< Location: https://www.yahoo.com/
< Content-Length: 8
<
* Connection #0 to host 98.139.180.180 left intact
redirect
curl
首先是 url,以确保它返回您期望的数据,然后继续
ab
.
关于hosts - 如何强制 Apache Bench 使用/etc/hosts 中指定的 IP 地址?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27882679/
目的:基准测试的主要目的是比较不同实现方式之间的性能差异,找出性能瓶颈。 1 准备以 _test.go 结尾文件和导入 testing 包 在命名文件时需要让文件
我正在尝试从另一个 VM 上测试 apache 服务器。 运行命令: ab -n 1000 -c 50 -s 30 http://192.168.2.156:80/ 我收到大约 900 个失败的请求
我已经安装了 Scrapy 0.22.2 并且能够运行 DirBot 代码示例而没有任何问题。但是,当我运行 Bench 命令时,出现了一些错误和异常。除了端口 8998 不接受连接之外,下面还有什么
我正在按照教程从its GitHub page运行docker bench 我执行它如下: C:/ docker ps C:/ docker run -it --net host --pid hos
我希望每按一次按钮,文本视图就会增加2.5,但应用程序始终崩溃。我尝试使用数字选择器,但我不喜欢它的垂直方向。我决定自己动手,后来又添加了长按功能,但现在我正在尝试按钮。 import android
我正在处理 Project Euler问题,我将每个问题都放在不同的文件中。当我对每个问题尝试不同的方法时,我会在其各自的文件中为每个问题创建一系列基准。 我的目录结构如下: euler/ C
我正在使用 Locust用于对我的网站进行负载测试,我很好奇它与 Apache Bench 在术语方面的区别。 使用 Apache Bench,您可以指定请求数 (-n) 和多个请求数,或并发数 (-
我正在使用 Locust用于对我的网站进行负载测试,我很好奇它与 Apache Bench 在术语方面的区别。 使用 Apache Bench,您可以指定请求数 (-n) 和多个请求数,或并发数 (-
我用 cargo bench 对我的 Rust 项目进行了基准测试,并在结果上看到了很多数字……它们是什么意思? 2 tests test bench_few_core ... bench: 26,
引用this answer to a Stack Overflow question : 什么是“基准测试代码”? (不要与基准混淆。) 大概是嵌入在里面的某种代码评论并在质量保证/测试的上下文中使用
对于在 CSS 中包含大量 :after 和 :before 的网页,是否有一种方法可以衡量(显示)性能? 我认为对每个元素的渲染时间影响很小,在现代计算机上没有问题,但在慢速移动设备上。 最佳答案
我正在对这段代码进行基准测试: use Bench; my $b = Bench.new; say 'start'; my $i=0; $b.timethese(100000, { first
当我运行 apache bench 时,我得到如下结果: Command: abs.exe -v 3 -n 10 -c 1 https://mysite Connection Times (ms)
我在 Web 服务上使用 apache bench 运行基准测试。我知道测试期间有 1-2 个请求会超时(这是一个 Web 框架问题)。当发生超时时,ab 退出并显示消息apr_pollset_pol
是否存在像 ab (apache bench) for mysql 这样的工具? 例如:我创建了一个表格,我根据需要填充(一些 MO 行) 然后: shell> 工具 -conccurency=20
下面是一个 apache bench 运行 10K 请求和 50 个并发线程。 我需要帮助来理解结果,结果中是否有任何突出的东西可能指向每秒阻塞和限制更多请求的东西? 我正在查看连接时间部分,看到“正
我创建了一个非常简单的基准测试来说明短字符串优化,并在 quick-bench.com 上运行它。该基准测试在比较禁用/启用 SSO 的字符串类方面非常有效,结果与 GCC 和 Clang 非常一致。
我正在尝试使用 apache bench 在我的 rails 应用程序中加载测试创建操作,但 ab 似乎没有发送 POST 数据 - 尽管它确实正确提交了 POST 而不是 GET 请求。 这是我运行
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a software
我正在使用 ApacheBench 来获取一些基本的计时信息。很好的满足了我的需求。我注意到“-g file”创建了一个制表符分隔的文件,每个调用作为一行。但是,我无法确定列的定义。这是我最好的猜测:
我是一名优秀的程序员,十分优秀!