In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the knowledge of "what are HTTP service stress testing tools and related terms". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Terminology relating to pressure testing
Response time (RT): the time the system responds to a request.
Throughput (Throughput): the number of requests processed by the system per unit time
QPS query rate per second (Query Per Second): query rate per second is the number of queries per second that a server can respond to, and is a measure of how much traffic is processed by a particular query server within a specified period of time.
TPS (TransactionPerSecond): the number of transactions or transactions that the system can handle per second
Concurrent connections: the total number of requests accepted by the server at a given time
Stress testing tool ab
Ab, whose full name is Apache Bench, is a performance testing tool that comes with Apache. Using this tool, you only need to specify the number of simultaneous connections, requests, and URL to test the performance of a website or website program.
By sending a request through ab to simulate multiple visitors accessing a URL address at the same time, we can get statistics such as the number of bytes per second, the number of requests per second, the processing time of each request and so on.
Command format:
Ab [options] [http://]hostname[:port]/path
The common parameters are as follows:
-n total number of requests requests-number of requests generated by c concurrency at a time, which can be understood as the number of concurrency-the maximum number of seconds performed by t timelimit tests, which can be used as the timeout of requests-p postfile contains files that require POST data-Content-type header information used by T content-type POST data
Please see the official documentation for more parameters.
For example, test a GET request interface:
Ab-n 10000-c 10000-t 10 "http://127.0.0.1:8080/api/v1/posts?size=10"
Test the POST request interface:
Ab-n 10000-c 100-t 10-p post.json-T "application/json"http://127.0.0.1:8080/api/v1/post"wrk"
Wrk is an open source HTTP performance testing tool. It belongs to the same HTTP performance testing tool as ab mentioned above. It is more powerful than ab and can support more complex test scenarios by writing lua scripts.
Install under Mac:
Brew install wrk
Common command parameters:
-c-conections: number of connections held-d-- duration: stress test duration (s)-t-- threads: total number of threads used-s-- script: load lua script-H-- header: add some parameters to the request header-- latency prints detailed delay statistics-- maximum timeout of timeout requests (s)
Examples of use:
Wrk-T8-C100-d30s-- latency http://127.0.0.1:8080/api/v1/posts?size=10
Output result:
Running 30s test @ http://127.0.0.1:8080/api/v1/posts?size=10 8 threads and 100connections Thread Stats Avg Stdev Max + /-Stdev Latency 14.55ms 2.02ms 31.59ms 76.70% Req/Sec 828.16 85.69 0.97k 60.46% Latency Distribution 50% 14.44ms 75% 15.76ms 16.63ms 99% 21.07ms 198091 requests in 30.05s 29.66MB readRequests/sec: 6592.29Transfer/sec: 0.99MBgo-wrk
Go-wrk is the Go language version of wrk,Windows students can use it to test, use the following command to install go-wrk:
Go get github.com/adeven/go-wrk
The usage is similar to wrk, and the basic format is as follows:
Go-wrk [flags] url
Commonly used parameters:
-H = "User-Agent: go-wrk 0.1bechmark\ nContent-Type: text/html ": request header separated by'\ n'-maximum number of connections used-k=true: whether to disable keep-alives-i=false: if TLS security checks are disabled-m=" GET ": HTTP request method-nreply 1000: total number of requests-tasking 1: number of threads used-b ="HTTP request body-s =" if specified, it will calculate the frequency of the string s that has been searched in the response
Perform the test:
Go-wrk-taper 8-cantilever 100-nude 10000 "http://127.0.0.1:8080/api/v1/posts?size=10"
Output result:
= BENCHMARK==URL: http://127.0.0.1:8080/api/v1/posts?size=10Used Connections: 100Used Threads: 8Total number of calls: 10000==TIMINGS==Total time passed: 2.74sAvg time per request: 27.11msRequests per second: 3644.53Median time per request: 26.88ms99th percentile time: 39.16msSlowest time for request: 45.00ms==DATA==Total response body sizes: 340000Avg response body per request: 34.00 ByteTransfer rate per second: 123914.11 Byte/s (0.12 MByte/s) = = RESPONSES==20X Responses: 10000 (100.00%) 30x Responses: 0 (0.000%) 40X Responses: 0 (0.002%) ) 50x Responses: 0 (0.005%) Errors: 0 (0.005%) what are the HTTP service stress testing tools and related terms? Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.