Skip to content

Apache ab 来并发测试一个 Rest Service #2

@davideuler

Description

@davideuler
  • post_loc.txt contains the json you want to post
  • -p means to POST it
  • -H adds an Auth header (could be Basic or Token)
  • -T sets the Content-Type
  • -c is concurrent clients
  • -n is the number of requests to run in the test

ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/

https://gist.github.com/kelvinn/6a1c51b8976acf25bd78

ab -n 30 -c 10 -s 300 -T application/json -H 'Content-Type: application/json' -p ./input.json http://localhost/api/v0/search/

https://httpd.apache.org/docs/2.4/programs/ab.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions