Apache ab 来并发测试一个 Rest Service

Open
#2 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
apache
Domain
cli, documentation

Research direction

No repository file or documentation entry point is named. Start by locating the project’s existing tips or documentation structure, then review the Apache ab reference and the examples using post_loc.txt and input.json. Done means adding this concurrent REST-service testing tip in the appropriate location with the command options explained accurately.

Written by the indexing model from the issue text.

Description

  • 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

Dominant language
Python
Stars
5
Forks
2
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from davideuler/programming-tips

All issues in davideuler/programming-tips

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.