Wrk
# macos
brew install wrk
wrk --help
# debian / ubuntu
sudo apt install build-essential libssl-dev git -y
git clone https://github.com/wg/wrk.git && cd wrk
sudo make && sudo cp wrk /usr/local/bin
ls -lah /usr/local/bin|grep wrk
sudo make clean
wrk --help
Playground
cat <<'EOF' > ~/Documents/wrk-playground/test-urlencoded-data.lua
wrk.method = "POST"
wrk.body = "width=2&height=2"
wrk.headers['Content-Type'] = "application/x-www-form-urlencoded"
EOF
wrk -t 4 -c 100 -d 180s\
-s ~/Documents/wrk-playground/test-urlencoded-data.lua\
--latency "http://server_ip:1234/demo"
|
cat <<'EOF' > ~/Documents/wrk-playground/test-application-json.lua
wrk.method = "POST"
wrk.body = '{"width": 2, "height": 2}'
wrk.headers['Content-Type'] = "application/json"
EOF
wrk -t 4 -c 100 -d 180s\
-s ~/Documents/wrk-playground/test-application-json.lua\
--latency "http://server_ip:1234/demo"
|
| |
References
| ||