【问题标题】:Apache ab will not work - ab: invalid URL when testing python cycloneApache ab 将不起作用 - ab:测试 python 旋风时的 URL 无效
【发布时间】:2012-05-07 14:26:56
【问题描述】:

我正在尝试 ab 测试旋风。

当我跑步时

ab -n 2000 -c 25 http://127.0.0.1

我得到 ab: 无效的 URL。

嗯...当我在我的开发机器上转到 ff 时,该站点就在那里。

这是我的 nginx 配置

http {

    upstream frontends {
        server 127.0.0.1:8051;
    }

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 30;
    types_hash_max_size 2048;
    # server_tokens off;
    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

        # Only retry if there was a communication error, not a timeout
        # on the Tornado server (to avoid propagating "queries of death"
        # to all frontends)
        proxy_next_upstream error;

    server {
        listen   80;
        server_name 127.0.0.1;

                location / {
            proxy_pass_header Server;
            proxy_set_header Host $http_host;
            proxy_redirect false;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Scheme $scheme;
                 proxy_pass http://frontends;
        }

【问题讨论】:

    标签: nginx apachebench cyclone


    【解决方案1】:

    ab 在 URL 后需要一个斜杠。

    这应该可行:

    ab -n 2000 -c 25 http://127.0.0.1/
    

    【讨论】:

    • 您会认为ab 会足够聪明地告诉您或修复它。来吧,这甚至只是一行代码!为这个答案干杯。
    • 正是我遇到的问题,我尝试的所有主机都减去了斜杠 - 谢谢!
    • 谢谢!这就是我需要的。正如卢克所说,你认为它可能会处理这个问题。
    猜你喜欢
    • 1970-01-01
    • 2012-09-25
    • 1970-01-01
    • 1970-01-01
    • 2020-10-09
    • 2018-06-23
    • 1970-01-01
    • 2016-12-23
    • 2017-03-01
    相关资源
    最近更新 更多