Giter Site home page Giter Site logo

linkxzhou / http_bench Goto Github PK

View Code? Open in Web Editor NEW
652.0 652.0 26.0 26.86 MB

golang HTTP stress testing tool, support single and distributed, http/1, http/2 and http/3.

Home Page: https://http-bench.vercel.app

Go 79.43% HTML 20.38% Dockerfile 0.20%
benchmark distributed golang http1 http2 http3 httpbench httpclient stress stress-testing tiny-tools websocket

http_bench's Introduction

Hi 👋, 我是linkxzhou

Github

🙋 自我介绍

✍️  大家好,我是linkxzhou! 目前是某大厂是高级程序员,方向是做后台和云原生方向,正在转向AI工程领域,个人微信公众号是《周末程序猿》(微信,知乎,掘金同号),里面积累了一些技术文章,如果您感兴趣可以关注!

Github Stats

http_bench's People

Contributors

linkxzhou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

http_bench's Issues

关于-c参数执行报错的问题

以下是必现的问题
./http_bench -c 1000 -d 20s -url https://www.test.com
-c参数好像超过500就一定会报错,500就正常,我的机器CPU是8核
[ERROR] err: Get "https://www.test.com/kkk": dial tcp 192.168.1.3:443: i/o timeout (Client.Timeout exceeded while awaiting headers)
[ERROR] err: Get "https:/www.test.com/kkk": dial tcp 192.168.1.3:443: i/o timeout (Client.Timeout exceeded while awaiting headers)
[ERROR] err: Get "https://www.test.com/kkk": dial tcp 192.168.1.3:443: i/o timeout (Client.Timeout exceeded while awaiting headers)
[ERROR] err: Get "https://www.test.com/kkk": dial tcp 192.168.1.3:443: i/o timeout (Client.Timeout exceeded while awaiting headers)
[ERROR] err: Get "https://www.test.com/kkk": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
[ERROR] err: Get "https://www.test.com/kkk": dial tcp 192.168.1.3:443: i/o timeout (Client.Timeout exceeded while awaiting headers)
[ERROR] err: Get "https://www.test.com/kkk": dial tcp 192.168.1.3:443: i/o timeout (Client.Timeout exceeded while awaiting headers)
[ERROR] err: Get "https://www.test.com/kkk": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
[ERROR] err: Get "https://www.test.com/kkk": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
[ERROR] err: Get "https://www.test.com/kkk": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
[ERROR] err: Get "https://www.test.com/kkk": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
[ERROR] err: Get "https://www.test.com/kkk": dial tcp 192.168.1.3:443: i/o timeout (Client.Timeout exceeded while awaiting headers)
[ERROR] err: Get "https://www.test.com/kkk": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

每秒控制速率不够精准?

测试了一下,感觉每次实际打出来的rps 和设置的 总是有误差,有时候差距还比较大,控制不够精准

working with URLs from file uses only the first line (so it seems not random)

I think reading URLs from a file doesn't work as expected.
(I expected all the lines to be used and even at random.)

http_bench -n 1000 -c 100 -m GET -url-file stress.txt -verbose 1
My stress.txt

http://localhost
http://localhost/todo
http://localhost/todo/1
http://localhost/country
http://localhost/country/1
http://localhost/language
http://localhost/language/1
http://localhost/user
http://localhost/user/1

I can see that multiple lines are recognised:

Request params: {
        "sequence_id": 1670661308,
        "cmd": 0,
        "request_method": "GET",
        "request_body": "",
        "request_script_body": "",
        "request_httptype": "http1",
        "n": 1000,
        "c": 100,
        "duration": 10,
        "timeout": 3000,
        "qps": 0,
        "disable_compression": false,
        "disable_keepalives": false,
        "auth_username": "",
        "auth_password": "",
        "headers": null,
        "urls": [
                "http://localhost/todo",
                "http://localhost/todo/1",
                "http://localhost/country",
                "http://localhost/country/1",
                "http://localhost/language",
                "http://localhost/language/1",
                "http://localhost/user",
                "http://localhost/user/1",
                "http://localhost"
        ],
        "output": ""

but when I look at my webserver logging, I can see that only the first URL gets all the hits.
When I shuffle my stress.txt URLs, another first line gets all the hist

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.