Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use HTTP stress testing tool wrk

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is to share with you about how to use the HTTP stress testing tool wrk. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

Wrk is a simple HTTP stress testing tool, hosted on Github, https://github.com/wg/wrk.

A good feature of wrk is that it can squeeze a large amount of concurrency with a small number of threads.

Mac installation: brew install wrk

Parameter description:

-c,-- connections: total number of connections (connections per thread = total connections / threads)-d,-- duration: duration of the test, such as 2s (2second), 2m (2minute), 2h (hour)-t,-- threads: total number of threads that need to be executed-s,-- script: execute the Lua script, where the path and name of the lua script are written Later, we will give the case-H,-- header: the header information that needs to be added, pay attention to the syntax of header, for example,-H "token: abcdef", explain, token, colon, space, abcdefg (don't forget the space, otherwise you will report an error). -- latency: displays delay statistics-- timeout: timeout time

Execute demo: wrk-T1-d20s-c100 http://127.0.0.1:8080/outer/blackIpInfo description: use 1 thread, 100 connections to execute 20s

Execution result:

1 threads and 100 connections

Thread Stats Avg (average) Stdev (standard deviation) Max (maximum) + /-Stdev (proportion of plus or minus one standard deviation)

Latency (delay) 53.46ms 17.90ms 333.35ms 89.40%

Req/Sec (number of requests in processing) 1.88k 409.58 2.57k 69.02%

56190 requests in 30.05s, 20.84MB read

Requests/sec (average number of requests completed per second): 1869.61

Transfer/sec (average read data per second): 710.15KB

The above is how to use the HTTP stress testing tool wrk. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report