In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces Apache how to achieve ab concurrent load stress testing, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to understand it.
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)
Download and install:
Http://mirror.bit.edu.cn/apache//httpd/binaries/win32/?C=M;O=A
Find httpd-2.2.21-win32-x86-no_ssl.msi.
Parameter document:
Http://httpd.apache.org/docs/2.2/programs/ab.html
Run:
On Windows, open the cmd command line window and navigate to the bin directory of the apache installation directory
Cd C:\ Program Files (x86)\ Apache Software Foundation\ Apache2.2\ bin
Type the command:
Ab-n 800-c 800 http://192.168.0.10/
(- n sends out 800 requests,-c simulates 800 concurrency, equivalent to 800 simultaneous visits, followed by test url)
Ab-t 60-c 100 http://192.168.0.10/
Send 100 requests at a time within 60 seconds.
/ / if you need to take parameters in url, do this
Ab-t 60-c 100-T "text/plain"-p p.txt http://192.168.0.10/hello.html
P.txt is in the same directory as ab.exe.
Parameters can be written in p.txt, such as p=wdp&fq=78
Result parameter explanation:
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/
Benchmarking 192.168.0.10 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Finished 800 requests
Server Software: Microsoft-HTTPAPI/2.0
Server Hostname: 192.168.0.10
Server Port: 80
Document Path: /
Document Length: body length of 315 bytes HTTP response data
Concurrency Level: 800
Time taken for tests: 0.914 seconds how long it takes for all these requests to be processed
Complete requests: 800 completed requests
Failed requests: 0 failed requests
Write errors: 0
Non-2xx responses: 800
Total transferred: 393600 total transmission of bytes network
HTML transferred: 252000 bytes HTML content transfer
Requests per second: 875.22 [# / sec] (mean) Throughput-requests per second
Time per request: 914.052 [ms] (mean) the time it takes for the server to receive the request and respond to the page
Time per request: 1.143 [ms] (mean, across all concurrent requests) average time spent per request concurrent
Transfer rate: 420.52 [Kbytes/sec] received average network traffic per second, which can help eliminate the problem of excessive network traffic leading to longer response time.
Decomposition of time spent on the network:
Connection Times (ms)
Min mean [+ /-sd] median max
Connect: 0 1 0.5 1 3
Processing: 245 534 125.2 570 682
Waiting: 11 386 189.1 409 669
Total: 246 535 125.0 571 684
The response of all requests in the entire scenario. There is a response time for each request in the scenario
50% of the users' response time is less than 571 milliseconds.
80% of users' response time is less than 652 milliseconds
Maximum response time is less than 684 milliseconds
Percentage of the requests served within a certain time (ms)
50% 571
66% 627
75% 646
80% 652
90% 666
95% 677
98% 681
99% 682
100% 684 (longest request)
Thank you for reading this article carefully. I hope the article "how to implement ab concurrent load stress testing in Apache" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.