Wrk: Difference between revisions
Jump to navigation
Jump to search
Line 14: | Line 14: | ||
==Playground== | ==Playground== | ||
<source lang=" | <source lang="bash"> | ||
cat <<'EOF' > ~/Documents/wrk-playground/test-urlencoded-data.lua | cat <<'EOF' > ~/Documents/wrk-playground/test-urlencoded-data.lua | ||
wrk.method = "POST" | wrk.method = "POST" | ||
Line 20: | Line 20: | ||
wrk.headers['Content-Type'] = "application/x-www-form-urlencoded" | wrk.headers['Content-Type'] = "application/x-www-form-urlencoded" | ||
EOF | EOF | ||
wrk -t 4 -c 100 -d 180s\ | |||
-s ~/Documents/wrk-playground/test-urlencoded-data.lua\ | |||
--latency "http://server_ip:1234/demo" | |||
</source> | </source> | ||
Revision as of 02:59, 15 January 2024
# 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"
References
| ||