我针对一个我认为应该无缝工作的页面测试了 Artillery.io(云规模负载测试):www.google.com :)
我现在想知道炮兵是否可靠。我收到 47 个错误。600 个 http 请求中出现 ETIMEDOUT。
这怎么可能,我错过了什么吗?我预计会有 0 个超时请求。
npm install -g artillery
artillery run landing-page-test.json
// landing-page-test.json
{
"config": {
"target": "https://wwww.google.com/",
"phases": [
{
"duration": 60,
"arrivalRate": 10
}
]
},
"scenarios": [
{
"name": "Load test landing page",
"flow": [
{
"get": {
"url": "/"
}
}
]
}
]
}
Artillery 会将请求的超时设置默认为 10 秒。如果您的某些请求花费的时间比这更长,您将收到
ETIMEDOUT
错误 - 所以这可能就是原因。
您可以在最终结果中看到 p99 约为 3.3 秒,这表明已经有一些请求花费了更长的时间。其他 47 个请求可能花费了 10 秒以上,因此超时。
这可能是由于您运行 Artillery 的地方的带宽/网络问题造成的。例如,我刚刚运行了你的脚本,没有
ETIMEDOUT
错误,p99 为 1.5 秒(而且我的信号目前实际上不是很强)。