当前位置:网站首页>Installation and use of Apache bench (AB pressure test tool)
Installation and use of Apache bench (AB pressure test tool)
2022-04-23 04:31:00 【The hunter is eating meat】
List of articles
1、Apache Bench brief introduction
Apache Bench yes Apache One from the server web Pressure test tools , abbreviation ab .
ab Very practical , It's not just about apache The server carries on the website visit stress test , You can also stress test other types of servers . such as nginx、tomcat、IIS etc.
2、ab Principle
ab Principle :ab The command creates Multiple concurrent Access thread , simulation Multiple visitors At the same time URL Address Visit .
Its test objectives are based on URL Of , therefore , It can be used to test apache Load pressure , You can also test nginx、lighthttp、tomcat、IIS Others, such as Web Server pressure .
ab Is a command line tool , ab Commands require very little of the computer issuing the load , It doesn't take up too much CPU, It doesn't take up a lot of memory . But it can put a huge load on the target server , The principle is similar CC attack . You should also pay attention to the use of your own test , Otherwise, too much load is put on at once . The target server may run out of resources , It can even crash in severe cases .
in general ab The tools are small and simple , It's faster to learn , It can provide the required basic performance indicators , But there is no graphical result , Can't monitor .
3、ab install
3.1、linux yum install
yum install httpd-tools
perhaps
yum -y install httpd-tools
Test the installation for success :
[root@vic html]# ab -V
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
3.2、win10 install
First , Need to install Apache The server , Download address :https://www.apachelounge.com/download/ ,
Because I am. 64 Bit operating system select , So choose a compressed package above , As shown in the figure below :
After downloading , Get the following list :
Direct double click abs.exe
Can't open .
The right way is to open cmd command , Get into Apache Bench Of bin Catalog , start-up abs.exe
, As shown in the figure below :
4、 Parameter Introduction :
Format :ab [options] [http://]hostname[:port]/path
Here are the parameters
-n requests Number of requests to perform // The total number of requests initiated by this test
-c concurrency Number of multiple requests to make // Number of requests generated at one time ( Or concurrent number )
-t timelimit Seconds to max. wait for responses // The maximum number of seconds a test is performed , There is no time limit by default .
-r Don't exit on socket receive errors. // Throw an exception to continue the test task
-p postfile File containing data to POST // Contains the need POST Data files for , File format such as “p1=1&p2=2”. How to use it -p 111.txt
-T content-type Content-type header for POSTing
// POST Data used Content-type Header information , Such as -T “application/x-www-form-urlencoded” . ( coordination -p)
-v verbosity How much troubleshooting info to print
// Set the detail level of the displayed information – 4 Or higher will display header information , 3 Or higher to display the response code (404, 200 etc. ), 2 Or higher to display warnings and other information . -V Show version number and exit .
-C attribute Add cookie, eg. -C “c1=1234,c2=2,c3=3” (repeatable)
//-C cookie-name=value Attach a... To the request Cookie: That's ok . Its typical form is name=value One of the parameters of . This parameter can be repeated , Split with a comma .
Tips : Can use session Implement the principle transfer JSESSIONID Parameters , Realize the function of keeping conversation , Such as -C ” c1=1234,c2=2,c3=3, JSESSIONID=FF056CD16DA9D71CB131C1D56F0319F8″ .
-w Print out results in HTML tables // With HTML Format output result of table . by default , It's a table with two columns of width on a white background .
-i Use HEAD instead of GET
5、 Examples of use
Many parameters , Usually we use -n
and -c
Parameters are OK . for example :
abs.exe -n 100 -c 20 Test website
-n
hinder 100, Indicates a total of 100 A request ;-c
hinder 20 , Said the 20 concurrent ( simulation 20 Personal simultaneous access ),- The following URL indicates the goal of the test URL.
Carry out a simple stress test on Baidu : abs.exe -n 100 -c 20 https://www.baidu.com/
Running results :
Document Path: The test page
Document Length: Page size
Concurrency Level: The number of concurrent tests
Time taken for tests: Duration of the whole test
Complete requests: Number of requests completed
Failed requests: Number of failed requests
Total transferred: Network traffic throughout the process
HTML transferred: In the whole process HTML Content delivery
Requests per second: One of the most important indicators , amount to LR Transactions per second in , In the back bracket mean That means that this is an average
Time per request: Two of the most important indicators , amount to LR The average transaction response time in , In the back bracket mean That means that this is an average
Time per request: The average of the actual run time of each connection request
Transfer rate: Average traffic on the network per second , It can help to eliminate the problem of extended response time caused by excessive network traffic
Reprint :
https://www.cnblogs.com/myvic/p/7703973.html
https://blog.csdn.net/weixin_39089928/article/details/87371792
版权声明
本文为[The hunter is eating meat]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230417436436.html
边栏推荐
- Second kill all interval related problems
- As a code farmer, what kind of experience is it that a girlfriend can code better than herself?
- 【BIM入门实战】Revit中的墙体层次以及常见问题解答
- C语言常用字符串处理函数
- Coinbase:关于跨链桥的基础知识、事实和统计数据
- matlab讀取多張fig圖然後合並為一張圖(子圖的形式)
- Introduction to Cortex-M3 register set, assembly language and C language interface
- 重剑无锋,大巧不工
- [AI vision · quick review of NLP natural language processing papers today, No. 32] wed, 20 APR 2022
- 优麒麟 22.04 LTS 版本正式发布 | UKUI 3.1开启全新体验
猜你喜欢
随机推荐
从MySQL数据库迁移到AWS DynamoDB
IEEE Transactions on Systems, Man, and Cybernetics: Systems(TSMC)投稿须知
智能电子秤全国产化电子元件推荐方案
Why recommend you to study embedded
那些年我面试过的Android开发岗总结(附面试题+答案解析)
补:注解(Annotation)
MYSQL去重方法汇总
Does China Mobile earn 285 million a day? In fact, 5g is difficult to bring more profits, so where is the money?
Basic introduction to spot gold
Mysql出现2013 Lost connection to MySQL server during query
兼容NSR20F30NXT5G的小体积肖特基二极管
520.检测大写字母
上海航芯技术分享 | ACM32 MCU安全特性概述
HMS Core Discovery第14期回顾长文|纵享丝滑剪辑,释放视频创作力
[BIM introduction practice] wall hierarchy and FAQ in Revit
[AI vision · quick review of NLP natural language processing papers today, No. 32] wed, 20 APR 2022
OpenCV----YOLACT实例分割模型推理
IDE Idea 自动编译 与 On Upate Action 、 On Frame Deactivation 的配置
Matlab reads multiple fig graphs and then combines them into one graph (in the form of sub graph)
Fusobacterium -- symbiotic bacteria, opportunistic bacteria, oncobacterium