Markdown

[Symfony] How to request with json in ApacheBench

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

# 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  -T application/json -H 'id:1,amount:1' -c 10 -n 2000 http://127.0.0.1:8000/bank/deposit

deposit

ab -p ./abdpost.txt -T application/json  -c 10 -n 2000 http://127.0.0.1:8000/bank/deposit


withdrawals

ab -p ./abdpost.txt -T application/json  -c 10 -n 2000 http://127.0.0.1:8000/bank/withdrawals

留言