miller
发布于

shell 循环请求

#for i in {1..1000};do curl 127.0.0.1:9002/num$i; sleep 1 ;done

shell循环测试

python3 -m http.server 30001
python3 -m http.server 30002
启动2个http server

nginx config

    upstream testhttp {
        server 127.0.0.1:30001 weight=1000;
        server 127.0.0.1:30002 weight=1;
        }

server {
        listen       9002;
        server_name  www.maocaoying.com;

        #charset koi8-r;

        location / {
            proxy_pass http://testhttp/;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

    }

https://docs.nginx.com/nginx/admin-guide/load-balancer/http-load-balancer/

浏览 (782)
点赞
收藏
1条评论