In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article uses easy-to-understand examples to introduce how to use apache ab, the code is very detailed, interested friends can refer to, hope to be helpful to you.
Ab introduction
Ab is an abbreviation for Apache HTTP server benchmarking tool and can be used to test the server performance of HTTP requests. It provides a simple and easy-to-use combination of performance testing tools through different parameters on the command line.
Principle of ab command
Apache's ab command simulates multithreaded concurrent requests to test server load pressure, as well as other Web servers such as nginx, lighthttp, IIS, and so on.
The ab command has very low requirements on the computer that issues the load, which will not take up a lot of CPU or too much memory, but it will cause a huge load on the target server, so it is a necessary medicine for some DDOS attacks, both young and old. You should also be careful when using it yourself. Otherwise, if there is too much load at one time, the target server will crash directly because of running out of memory, and the loss will outweigh the gain.
In the case of insufficient bandwidth, it is best to test locally. It is recommended to use another or more servers in the private network to test through the private network. The data obtained in this way will be much more accurate. Remote stress testing of web servers is often not satisfactory (because of excessive network latency or insufficient bandwidth)
Don't say much about installation, as long as you install Apache, you can refer to the previous article
Method of using basic parameters 1
Parameter description:-n requests,-c concurrency
Ab-n1000-c10 https://www.baidu.com/ represents 1000 requests to Baidu's home page, with a concurrency of 10.
The results show that
Version information description
This is ApacheBench, Version 2.3 Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/Licensed to The Apache Software Foundation, http://www.apache.org/
Progress description
Benchmarking www.baidu.com (be patient) Completed 100 requestsCompleted 200 requestsCompleted 300 requestsCompleted 400 requestsCompleted 500 requestsCompleted 600 requestsCompleted 700 requestsCompleted 800 requestsCompleted 900 requestsCompleted 1000 requestsFinished 1000 requests
Server information
Server Software: BWS/1.1Server Hostname: www.baidu.comServer Port: 443SSL/TLS Protocol: TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048128Document Path: / Document Length: 227 bytesConcurrency Level: 10Time taken for tests: 4.958 secondsComplete requests: 1000Failed requests: 0Write errors: 0Total transferred: 872000 bytesHTML transferred: 227000 bytes
Throughput of the server, request processing per second
Requests per second: 201.68 [# / sec] (mean)
Average waiting time for users
Time per request: 49.584 [ms] (mean)
Processing time of a single request on the server side
Time per request: 4.958 [ms] (mean, across all concurrent requests)
Received average network traffic per second, which can help eliminate the problem of excessive network traffic leading to longer response time.
Transfer rate: 171.74 [Kbytes/sec] receivedConnection Times (ms) min mean [+ /-sd] median maxConnect: 27 36 39.0 34 1246Processing: 10 13 1.9 13 33Waiting: 10 13 13 1.9 13 33Total: 38 49 39.1 47 1258
The response of all requests in the entire scenario.
Percentage of the requests served within a certain time (ms) 50% 4766% 4975% 5080% 5190% 5395% 5698% 5889% 62100% 1258 (longest request)
Usage summary
Whether a.ab is successful or not is only to judge the response result of 2xx.
b. It is only suitable for the stress test of a simple interface or page.
C.ab can also fill in the parameters for stress test.
On how to use apache ab to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.