Apache ab无法正常工作 - ab:测试python cyclone时无效的URL

Tam*_*mpa 30 nginx apachebench cyclone

我试图ab测试旋风.

我跑的时候

ab -n 2000 -c 25 http://127.0.0.1
Run Code Online (Sandbox Code Playgroud)

我得到ab:无效的网址.

嗯......当我在我的开发机器上去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;
        }
Run Code Online (Sandbox Code Playgroud)

fio*_*rix 139

你只是错过了斜线.

这应该工作:

ab -n 2000 -c 25 http://127.0.0.1/
Run Code Online (Sandbox Code Playgroud)

  • 你会认为`ab`足够聪明,可以告诉你这个,或者修复它.来吧,那几乎只有一行代码!为这个答案干杯. (17认同)
  • 究竟我遇到了什么问题,我尝试的所有主机都减去了斜线 - 谢谢! (3认同)