Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Detailed explanation of pressure testing tool ab (Apache)

Shulou Source: shulou.com Published: 2022-06-03 07:18:17 10月04日 Update

Small preface: compared with several lightweight stress testing tools. Siege http_load ab webbench.siege eats too much memory (ab consumes relatively less resources under the same number of requests and concurrency)

Introduction to ab:

The full name of ab is: apache bench, and the official note is:

Apache Hypertext transfer Protocol (HTTP) performance testing tool. It is designed to describe the execution performance of the currently installed Apache, mainly to show how many requests your installed Apache can handle per second. Apache comes with stress testing tools. Ab is very practical. It can be used not only for website access stress testing of apache servers, but also for other types of servers. Such as nginx, tomcat, IIS and so on.

I. installation

You can install the Apache tool directly under Linux.

Yum install-y httpd-tools

2. Use

Eg.

Ab-n 200000-c 10000 "http://jd.com/"

-n is the number of requests

-c is the concurrent number

After executing the command, you can see the following test report:

III. Frequently asked questions

1. Sometimes when you set a large concurrency parameter, such as 1000 or 10000cycles, the following error will be reported when executing the command:

Explanation: check the application server and database are not reported error, the connection is reset, apr_socket_recv is a parameter of the OS kernel, high concurrency, the kernel will think that the system is subjected to SYN flood***, will send cookies (possible SYN flooding on port 80. Sending cookies), which slows down the speed of requests, so large concurrency testing can be done by setting this parameter to 0 on the application server to disable system protection.

Tags: Testing tools servers services pressure parameters kernel commands performance testing tools systems applications practical same larger full name memory official frequently asked questions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information vpn MariaDB Huawei OPPO Reno