Mooon http-stress tutorial

Source: Internet
Author: User
File: Mooon-http-stress-manual.pdf
Size: 248kb
Download: Download
1. What is http-stress? HTTP-stress is an HTTP stress testing tool similar to AB (APACHE benchmark). It is a subsidiary application used for dispatcher, http_parser, and other tests. It has the following features: 1) multithreading 2) supports both IPv4 and ipv63) multi-user concurrency test (4) You can configure multiple different or identical urls5) You can test different IP addresses of the same domain name at the same time (6) timed output of Test Progress per second: number of successes and failures 7) long connection and short connection test 8) currently only the get method test is supported 2. test result sample [21:11:29] [0xf35bc6f0] [State] Time: 52 seconds [21:11:29] [0xf35bc6f0] [State] Total number: 100000 [21:11:29] [0xf35bc6f0] [State] Failure Number: 0 [2010- 10-15 21:11:29] [0xf35bc6f0] [State] success number: 98040 [21:11:29] [0xf35bc6f0] [State] percent Number: 1923 [21:11:29] [0xf35bc6f0] [State] Bytes Sent: 8600000 [21:11:29] [0xf35bc6f0] [State] bytes encoded ed: 32894278 and above are: total number of requests (number of requests per user * Number of users) number of successful requests the number of failed requests the number of bytes sent received 3. the configuration file must be configured with two files: tress. XML and route. table, tress. XML is used to configure test parameters, route. table is required by the dispatcher module. The route table. 3.1. route. table specifies the message to which it should be sent, which is a text file consisting of two parts: the first line must be the number of Route entries, and the format of the other lines must meet: the route ID \ t destination IP address \ t destination port. The IP address can be IPv4, IPv6, or domain name, and the route ID cannot be repeated. In addition, we recommend that you avoid domain name configuration as much as possible, because the system calls for domain name resolution are blocked, which will affect the authenticity of the test. If you need to use a domain name, we recommend that you configure the IP ing relationship in/etc/hosts. Route. table file examples. Note that they are separated by: 101 127.0.0.1 99992 127.0.0.1 99993 127.0.0.1 99994 127.0.0.1 99995 127.0.0.1 99996 127.0.0.1 99997 127.0.0.1 99998 127.0.0.1 99999 127.0.0.1 9999route. each route entry in a table represents a user. Therefore, the number of users must be configured through it, instead of through tress. xml configuration. The value range of the route ID is from 0 to 65535, which can be discontinuous. The mk_table.sh script can be used to automatically generate route. Table. The running parameter is: number of concurrent requests. The target IP address port is sh mk_table.sh 10 127.0.0.1 9999. 3.2. Each test parameter is defined in tress. XML, for example: <? XML version = "1.0" encoding = "gb2312"?> <Stress> <Log Level = "state"/> <thread number = "1"/> <connect keep_alive = "true"/> <request number = "1000" domain_name =" wagner. 0.0.1 "error_number =" 100 "/> <URLs> <URL value ="/"/> </URLs> </stress> <Log Level =" state "/>: log Level, except for debugging, because it is set to the state level <thread number = "1"/>: Number of threads <connect keep_alive = "true"/>: whether the request is a persistent connection <request number = "1000" domain_name = "127.0.0.1" error_number = "100"/>: the number of requests sent by each user respectively (not the total number of requests), the tested domain name, the maximum number of errors allowed Number (the process will exit if this number is exceeded ). URLs: URL list to be tested <URL value = "/"/>: One URL per line. The URL must be prefixed with "/" and can be repeated. 4. run http_stress directly without any parameters, but http_stress depends on libutil. so, libsys. so, Libnet. so, libdispatcher. so and libhttp_parser.so library files, so before running, you need to set the LD_LIBRARY_PATH environment variable, such as: Export LD_LIBRARY_PATH = $ mooon_home/lib. 5. Before compiling http-stress, you must first compile the common-library and common-component libraries ). Use SVN to download source code from the http://mooon.googlecode.com/svn/trunk. 5.1. compile the basic library (Common-Library) including util, sys, net, and plugin. The compilation procedure is as follows: 1) Go to the src directory of the basic library; 2) run the first_once.sh script, for example, SH first_once.sh (it is recommended that you use it like this because the first_once.sh removed from SVN does not have the executable permission. If you do not add the executable permission for it, directly. /first_once.sh ). The following operations follow automake; 3) Run configure to generate makefile, for example :. /configure -- prefix =/usr/local/mooon, where -- prefix is followed by the installation directory of mooon. 4) Compile the source file and run make. 5) install the file, run make install. After the basic library is compiled successfully, you can start to compile the public components. 5.2. the common-component depends on the common-library. Here, you only need to compile two public components: Dispatcher and HTTP-parser, do not compile other components because the compilation may fail. The steps for compiling public components are as follows: 1) Go to the src directory of public components; 2) run the first_once.sh script; 3) Run Configure. Specify the -- prefix parameter as the mooon installation directory. 4) Go to the dispatcher directory, run make to compile the source file 5) After dispatcher is compiled successfully, run make install to install 6) Go To The http_parser directory and run make to compile the source file 7) after http_parser is compiled successfully, run make install to install. Next we can start compiling http-stress. 5.3. compile http-stresshttp-stress, which belongs to the Web application. The compilation method is the same as follows: 1) enter the src directory of the Web application; 2) Run first_once.sh script; 3) Run configure, note that the -- prefix parameter is specified as the mooon installation directory. 4) Go To The http_stress directory and run make to compile the source file. 5) run make install after http_stress is compiled successfully. Assume that mooon_home represents the installation directory of mooon, then $ mooon_home/lib library file storage directory, $ mooon_home/bin is the directory of executable files such as http_stress, as shown below: mooon/| -- bin | -- http_stress | '-- mk_table.sh | -- conf | -- route. table | '-- stress. XML | -- include | -- sys | -- Net | -- plugin | '-- util | -- dispatcher | -- http_parser | -- lib | -- libdispatcher. so | -- libhttp_parser.so | -- Libnet. so | -- libsys. so | -- libutil. so | '-- libxtinyxml. so '-- log note: _ Home/lib is added to LD_LIBRARY_PATH to run http_stress. Otherwise, an error ". So" is reported during running. 6. in post-order mooon, HTTP-stress was born as a test tool for dispatcher and HTTP-parser. Therefore, it is rude and simple, there is still much room for improvement in ease of use and test output data. You are welcome to improve it and share it with us. If you need any help, or have any suggestions, or find any problems, please mail to the eyjian@qq.com, thank you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.