wrk壓測工具的使用

wrk壓測的git地址:https://github.com/wg/wrk

wrk安裝:直接下載然後解壓之後進入目錄然後make編譯即可。

get請求:

./wrk -t1 -c400 -d200s http://www.baidu.com

參數

-t代表線程數

-c代表連接數

-d代表請求持續時間

發送post請求時需要編寫一個lua文件

wrk.method = "POST"
wrk.body = '{"pushtoken":"fl9Hs_5Vs","params":{"dpi":320,"device_category":"phone"}}'
wrk.headers["Content-Type"] = "application/json"

post請求:

./wrk -t1 -c400 -d200s --script=http_post.lua http://www.baidu.com

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章