48

I am trying to ab test cyclone.

When I run

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

I get ab: invalid URL.

Well...when I go to ff on my dev machine, the site is there.

Here is my nginx config

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;
        }
skaffman
  • 398,947
  • 96
  • 818
  • 769
Tampa
  • 75,446
  • 119
  • 278
  • 425

1 Answers1

200

ab requires a trailing slash after the URL.

This should work:

ab -n 2000 -c 25 http://127.0.0.1/
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
fiorix
  • 3,619
  • 3
  • 19
  • 12
  • 36
    You'd think that `ab` would be clever enough to either tell you this, or to fix it. C'mon, that's barely even one line of code! Cheers for this answer. – Luke H Feb 19 '13 at 14:45
  • 4
    Exactly what the problem I had was, all hosts I was trying were minus the trailing slash - thanks! – ProNotion Feb 21 '14 at 08:31
  • Thank you! That's what I needed. As Luke said, you think it'd maybe handle this. – Darryl Young Oct 28 '20 at 10:19