GithubHelp home page GithubHelp logo

six-ddc / plow Goto Github PK

View Code? Open in Web Editor NEW
3.8K 30.0 131.0 2.82 MB

A high-performance HTTP benchmarking tool that includes a real-time web UI and terminal display

License: Apache License 2.0

Go 99.86% Dockerfile 0.14%
load-testing apachebench visualization http realtime performance cli load wrk

plow's Introduction

plow

build Homebrew GitHub license made-with-Go

Plow is an HTTP(S) benchmarking tool, written in Golang. It uses excellent fasthttp instead of Go's default net/http due to its lightning fast performance.

Plow runs at a specified connections(option -c) concurrently and real-time records a summary statistics, histogram of execution time and calculates percentiles to display on Web UI and terminal. It can run for a set duration( option -d), for a fixed number of requests(option -n), or until Ctrl-C interrupted.

The implementation of real-time computing Histograms and Quantiles using stream-based algorithms inspired by prometheus with low memory and CPU bounds. so it's almost no additional performance overhead for benchmarking.

❯ ./plow http://127.0.0.1:8080/hello -c 20
Benchmarking http://127.0.0.1:8080/hello using 20 connection(s).
@ Real-time charts is listening on http://[::]:18888

Summary:
  Elapsed        8.6s
  Count        969657
    2xx        776392
    4xx        193265
  RPS      112741.713
  Reads    10.192MB/s
  Writes    6.774MB/s

Statistics    Min       Mean     StdDev      Max
  Latency     32µs      176µs     37µs     1.839ms
  RPS       108558.4  112818.12  2456.63  115949.98

Latency Percentile:
  P50     P75    P90    P95    P99   P99.9  P99.99
  173µs  198µs  222µs  238µs  274µs  352µs  498µs

Latency Histogram:
  141µs  273028  ■■■■■■■■■■■■■■■■■■■■■■■■
  177µs  458955  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  209µs  204717  ■■■■■■■■■■■■■■■■■■
  235µs   26146  ■■
  269µs    6029  ■
  320µs     721
  403µs      58
  524µs       3

Installation

Binary and image distributions are available through the releases assets page.

Via Go

go install github.com/six-ddc/plow@latest

Via Homebrew

# brew update
brew install plow

Via Docker

docker run --rm --net=host ghcr.io/six-ddc/plow
# docker run --rm -p 18888:18888 ghcr.io/six-ddc/plow

Usage

Options

usage: plow [<flags>] <url>

A high-performance HTTP benchmarking tool with real-time web UI and terminal displaying

Examples:

  plow http://127.0.0.1:8080/ -c 20 -n 100000
  plow https://httpbin.org/post -c 20 -d 5m --body @file.json -T 'application/json' -m POST

Flags:
      --help                   Show context-sensitive help.
  -c, --concurrency=1          Number of connections to run concurrently
      --rate=infinity          Number of requests per time unit, examples: --rate 50 --rate 10/ms
  -n, --requests=-1            Number of requests to run
  -d, --duration=DURATION      Duration of test, examples: -d 10s -d 3m
  -i, --interval=200ms         Print snapshot result every interval, use 0 to print once at the end
      --seconds                Use seconds as time unit to print
      --json                   Print snapshot result as JSON
  -b, --body=BODY              HTTP request body, if start the body with @, the rest should be a filename to read
      --stream                 Specify whether to stream file specified by '--body @file' using chunked encoding or to read into memory
  -m, --method="GET"           HTTP method
  -H, --header=K:V ...         Custom HTTP headers
      --host=HOST              Host header
  -T, --content=CONTENT        Content-Type header
      --cert=CERT              Path to the client's TLS Certificate
      --key=KEY                Path to the client's TLS Certificate Private Key
  -k, --insecure               Controls whether a client verifies the server's certificate chain and host name
      --listen=":18888"        Listen addr to serve Web UI
      --timeout=DURATION       Timeout for each http request
      --dial-timeout=DURATION  Timeout for dial addr
      --req-timeout=DURATION   Timeout for full request writing
      --resp-timeout=DURATION  Timeout for full response reading
      --socks5=ip:port         Socks5 proxy
      --auto-open-browser      Specify whether auto open browser to show Web charts
      --[no-]clean             Clean the histogram bar once its finished. Default is true
      --summary                Only print the summary without realtime reports
      --version                Show application version.

  Flags default values also read from env PLOW_SOME_FLAG, such as PLOW_TIMEOUT=5s equals to --timeout=5s

Args:
  <url>  request url

Examples

Basic usage:

plow http://127.0.0.1:8080/ -c 20 -n 10000 -d 10s

POST a json file:

plow https://httpbin.org/post -c 20 --body @file.json -T 'application/json' -m POST

Bash/ZSH Shell Completion

# Add the statement to their bash_profile (or equivalent):
eval "$(plow --completion-script-bash)"
# Or for ZSH
eval "$(plow --completion-script-zsh)"

Stargazers

Stargazers over time

License

See LICENSE.

plow's People

Contributors

avdb13 avatar chenrui333 avatar dependabot[bot] avatar florianloch avatar npolyzotisatypon avatar shmulr avatar six-ddc avatar wweir 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  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

plow's Issues

Histogram is unclear

Histogram ranges seem to be of unequal length, and it is unclear what the value associated with a range represents:

  • midpoint of the range?
  • some well-defined mean of the values falling in the range?

Since ranges seem to be of unequal and therefore unknown length, it is impossible to exactly recover both ends of each range, even under the assumption that the numbers represent range midpoints.

Add support for basic auth

Hello!
Would be nice if you added the ability to test the routes protected by basic auth.
Some of my use cases require this thing, and I have to use ab as a fallback, which is something I don't really want...

can not pull project

when i run go get -u github.com/six-ddc/plow,i got

build github.com/six-ddc/plow: cannot load github.com/nicksnyder/go-i18n/i18n: cannot find module providing package github.com/nicksnyder/go-i18n/i18n

so i watch https://github.com/nicksnyder/go-i18n/, the pkg catalogue is changed. So

github.com/nicksnyder/go-i18n/i18n

changed

v2/github.com/nicksnyder/go-i18n/i18n

localhost IPv6 resolution

Hi there, thanks for your amazing work!
I recently found that plow doesn't seem to be able to resolve localhost to IPv6 address if IPv4 failed.

What I have observed

I have an endpoint that only allows IPv6 access:

$ curl -v http://localhost:8080/api/endpoint

*   Trying 127.0.0.1:8080...
* connect to 127.0.0.1 port 8080 failed: Connection refused
*   Trying [::1]:8080...
* Connected to localhost (::1) port 8080 (#0)
> GET /api/endpoint
> Host: localhost:8080
> User-Agent: curl/8.1.2
> Accept: */*
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< content-type: application/json
< content-length: 10
< connection: close
< date: Tue, 07 Nov 2023 12:00:00 GMT
< cache-control: no-store
< vary: Cookie
<
{"data": 1}

If I use plow, it drops the requests when it doesn't manage to connect to the IPv4 address 127.0.0.1:

$ plow -n 10 http://localhost:8080/api/endpoint
Benchmarking http://localhost:8080/api/endpoint with 10 request(s) using 1 connection(s).
@ Real-time charts is listening on http://[::]:18888

Summary:
  Elapsed         0s
  Count           10
  RPS       1542.933
  Reads    0.000MB/s
  Writes   0.000MB/s

Error:
  10  "dial tcp4 127.0.0.1:8080: connect: connection refused"

What I expect

plow can try to connect to IPv6 address when the IPv4 is refused while using localhost, like curl does

My setup

plow: 1.3.1
OS: macOS 13.6.1 22G313 x86_64
Shell: zsh 5.9
CPU: Intel i5-1038NG7 (8) @ 2.00GHz

Don't erase histogram?

Why are histogram bars in the terminal output erased once plow finishes, and only numerical output remains? Please keep the bars!

Export to csv/json

Can the final report be exported to CSV/JSON with the snapshot information

Defaulting to method POST when a body is set

I would suggest to set method to POST when no method is stated explicitly but --body is used.

Just as a minor quality-of-life improvement.

Would be willing to open a PR for that.

Plow not working with --body switch

Thanks for your hard work on this but seeking advice about what I believe may be a bug in Windows build version 1.1

Inputting a JSON file into the --body switch fails to copy the contents of the file into the request body of the HTTP command generated by plow

Sample JSON file as follows: (line-endings all in LF format)
{
"test": {
"test_id": "100",
"account_id": "2176db06-dc03-4f21-8de4-de38df531c53",
"funds_balance": "1",
"funds_withheld": "1",
"funds_escrow": "1",
"currency": "thb"
}
}

Expected that these contents will go into the request body of the generated command created by this:
plow http://localhost:4000/api/ -c 1 -n 1 --body @post.json --stream -T 'application/json' -m POST -H "Content-Length:262; Host:localhost:4000"

or this:
plow http://localhost:4000/api/ -c 1 -n 1 --body @post.json --stream -T 'application/json' -m POST

Many thanks. A sample JSON document would be so useful so I can confirm that my JSON document is formatted correctly.

add https skip verify flag

can you add https skip verify flag to ignore cert verify,like -k, --insecure in curl ?
or is there some way to do this in current version ?

🛠️

Why do you need to upgrade to

1.3.0 reports incorrect version

Hey, not a big deal but binaries downloaded from tag v1.3.0 report they are 1.2.0 with --version:

$ tar xf plow_1.3.0_darwin_amd64.tar.gz
$ ./plow --version
1.2.0

This might confuse some Ansible playbooks which use the stdout version to determine if a new binary needs to be downloaded.

发送文件压测指令如何编写

服务介绍

  • 压测服务是个简单的spring boot 文件上传服务
  • 预计需要使用from 表单+ multipart/form-data 参数上传,文件参数是file
  • 对应的curl: curl http://localhost:8000/predict -F "file=@/Users/gclm/Downloads/064A9498.jpg" -v

我的压测指令

目前我已经使用了上面所有的指令都显示不行,后台根本就无法获取到file对象,所以希望大佬可以指点一下如何编写这个指令,或者能否提供一个curl to plow 的工具呢?

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.