gpt4 book ai didi

ruby-on-rails - 如何使用apache bench在url中指定查询字符串

转载 作者:行者123 更新时间:2023-12-03 22:56:03 26 4
gpt4 key购买 nike

我的 rails 应用程序在瘦服务器上运行,我想使用 apachebench 对其进行基准测试

我使用的命令是

ab -n 1 -c 1 http://localhost:3001/welcome/search?query="doctor"&rad=5

但是瘦服务器没有使用这个 url.Its 给
!! Invalid Request

任何人都可以帮助我如何提供网址,以便瘦接受带有查询字符串的网址

最佳答案

apache 基准测试不会从 url 中解析出“localhost”。将其更改为 0.0.0.0 或 127.0.0.1 并引用整个 url 以避免与符号相关的问题。例如:

ab -n 1 -c 1 "http://0.0.0.0:3001/welcome/search?query=doctor&rad=5"

关于ruby-on-rails - 如何使用apache bench在url中指定查询字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2797561/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com