Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use http_load to stress test the server of Linux system

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to use http_load to do stress testing on the server of the Linux system". The explanation in the article is simple and clear, and easy to learn and understand. please follow the editor's train of thought to study and learn "how to use http_load to do stress testing on the server of the Linux system".

Introduce a http_load stress testing tool, http_load, and similar tools include webbench, ab, and Siege.

1. Download

Official website: http://acme.com/software/http_load/

The code is as follows:

Cd / root

Wget http://acme.com/software/http_load/http_load-12mar2006.tar.gz

Tar xzf http_load-12mar2006.tar.gz

2. Installation

The code is as follows:

Cd http_load-12mar2006

Make

After executing make, a http_ load binary file is generated in the current directory.

3. Usage

The code is as follows:

Root@www:~/http_load-12mar2006#. / http_load--help

Usage:. / http_load [- checksum] [- throttle] [- proxy host:port] [- verbose] [- timeout secs] [- sip sip_file]

-parallel N |-rate N [- jitter]

-fetches N |-seconds N

Url_file

One start specifier, either-parallel or-rate, is required.

One end specifier, either-fetches or-seconds, is required.

Description of main parameters:

-parallel abbreviation-p: means the number of concurrent user processes.

-rate abbreviation-r: means the frequency of visits per second

-fetches abbreviation-f: means the total number of visits

-seconds abbreviation-s: means total visit time

When selecting parameters,-parallel and-rate choose one of them, and-fetches and-seconds choose one of them.

Example:

Http_load-parallel 50-s 10 urls.txt

This command line uses 50 processes at the same time and randomly accesses the list of URLs in urls.txt for a total of 10 seconds.

Http_load-rate 50-f 5000 urls.txt

50 requests per second, for a total of 5000 stops.

4. Basic return value

(1) .49 fetches, 2 max parallel, 289884 bytes, in 10.0148 seconds

It indicates that 49 requests were run in the above test, the maximum number of concurrent processes is 2, the total data transferred is 289884bytes, and the running time is 10.0148 seconds.

(2) .5916 mean bytes/connection

It indicates that the average amount of data transmitted per connection is 289884 / 495916.

(3). 4.89274 fetches/sec, 28945.5 bytes/sec

It indicates that the response request per second is 4.89274 and the data passed per second is 28945.5 bytes/sec.

Msecs/connect: 28.8932 mean, 44.243 max, 24.488 min

The average response time per connection is 28.8932 msecs, the maximum response time is 44.243 msecs, and the minimum response time is 24.488 msecs.

(5) .msecs/first-response: 63.5362 mean, 81.624 max, 57.803 min

(6) HTTP response codes: code 200-49

Indicates the type of response page that is opened. If there are too many types of 403, you may want to pay attention to whether the system has encountered a bottleneck.

Special note: here, the indicators we generally pay attention to are fetches/sec and msecs/connect.

Their corresponding common performance metrics parameter Qpt- responds to users per second and response time, and responds to user time per connection. The results of the test mainly look at these two values. Of course, only these two indicators can not complete the performance analysis, we also need to analyze the cpu and men of the server in order to draw a conclusion.

5. If you need to test https, you must add Makefile

The code is as follows:

# CONFIGURE: If you want to compile in support for https, uncomment these

# definitions. You will need to have already built OpenSSL, available at

# http://www.openssl.org/ Make sure the SSL_TREE definition points to the

# tree with your OpenSSL installation-depending on how you installed it

# it may be in / usr/local instead of / usr/local/ssl.

SSL_TREE = / usr

SSL_DEFS =-DUSE_SSL

SSL_INC =-I $(SSL_TREE) / include

SSL_LIBS =-L $(SSL_TREE) / lib-lssl-lcrypto

Since you are using openssl, you must install openssl and the corresponding development environment

The code is as follows:

Apt-get install openssl

Apt-get install libssl-dev

Find-name ssl.h

/ usr/include/openssl/ssl.h

So the red font above must be modified.

Thank you for reading, the above is the content of "how to use http_load to do stress testing on the server of the Linux system". After the study of this article, I believe you have a deeper understanding of how to use http_load to do stress testing on the server of the Linux system, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report