Test the stress by using the test tool AB provided by Apache.

Source: Internet
Author: User

Introduction: This is a detailed page of the Apache test tool AB for stress testing. It introduces the knowledge, skills, and experience related to the stress testing of PHP and PHP Apache test tool AB, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 357334 'rolling = 'no'>

I don't know how to test Apache performance. For details, refer to the Apache test tool AB (apachebenchmark). In the Apache bin directory.
Format:./AB [Options] [http: //] hostname [: Port]/path
Parameters:

-N requests number of requests to perform
// The number of requests executed in the test session. By default, only one request is executed.
-C concurrency number of multiple requests to make
// The number of requests generated at a time. The default value is one at a time.
-T timelimit seconds to max. Wait for responses
// The maximum number of seconds for testing. The implicit value is-N 50000. It limits the server test to a fixed total time. By default, there is no time limit.
-P postfile file containing data to post
// File that contains the data to be post.
-T Content-Type Header for posting
// The Content-Type Header used by the post data.
-V verbosity how much troubleshooting info to print
// Set the details of the display information-4 or a greater value will display the header information, 3 or a greater value can display the response Code (404,200, etc.), 2 or greater values can display warnings and other information. -V displays the version number and exits.
-W print out results in HTML tables
// Output results in HTML table format. By default, it is a table of the width of the two columns of the white background.
-I use head instead of get
// Execute the head request instead of get.
-X attributes string to insert as table attributes
//
-Y attributes string to insert As tr attributes
//
-Z attributes string to insert as TD or th attributes
//
-C attribute add cookie, eg. 'apache = 1234. (repeatable)
//-C cookie-name = value attaches a cookie to the request: Row. The typical form is a parameter pair of name = value. This parameter can be repeated.
-H attribute add arbitrary header line, eg. 'Accept-encoding: gzip'
Inserted after all normal header lines. (repeatable)
-A attribute add basic WWW authentication, the attributes
Are a colon separated username and password.
-P attribute add basic proxy authentication, the attributes
Are a colon separated username and password.
//-P proxy-auth-UserName: password provides basic authentication trust for a transit proxy. The user name and password are separated by one and sent in base64 encoding format. This string is sent regardless of whether the server needs it (that is, whether the 401 authentication request code is sent.
-X Proxy: Port proxyserver and port number to use
-V print version number and exit
-K use HTTP keepalive feature
-D do not showpercentiles served table.
-S do not show confidence estimators and warnings.
-G filename output collected data to gnuplot format file.
-E filename output CSV file with percentages served
-H display usage information (this message)
//-Attributes: Set the attribute string. Defect Program There are various static declared fixed-length buffers. In addition, parsing command line parameters, server response headers, and other external inputs is also simple, which may have adverse consequences. It does not fully implement HTTP/1.x; only accept some 'preview' response formats. Frequent use of strstr (3) may cause performance problems, that is, you may be testing the performance of AB rather than the server.

There are many parameters. Generally we can use the-C and-N parameters. For example:

./AB-C 1000-N 1000 http: // 127.0.0.1/index. php

This indicates that 1000 requests are processed simultaneously and the index. php file is run 1000 times.
#/Usr/local/Xiaobai/apache2054/bin/AB-C 1000-N 1000 http: // 127.0.0.1/index.html. zh-cn.gb2312
This is apachetings, version 2.0.41-dev <$ revision: 1.121.2.12 $> APACHE-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd,
Copyright (c) 1998-2002 the Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (Be patient)
Completed100 requests
Completed200 requests
Completed300 requests
Completed400 requests
Completed500 requests
Completed600 requests
Completed700 requests
Completed800 requests
Completed900 requests
Finished 1000 requests
Server Software: Apache/2.0.54 // platform Apache 2.0.54
Server Hostname: 127.0.0.1 // server host name
Server port: 80 // server port

Document path:/index.html. zh-cn.gb2312 // document of the test page
Document length: 1018 bytes // document size

Concurrency level: 1000 // concurrency
Time taken for tests: 8.188731 seconds // duration of the test
Complete requests: 1000 // number of completed requests
Failed requests: 0 // number of failed requests

Love J2EE follow Java Michael Jackson video station JSON online tools

Http://biancheng.dnbcw.info/php/357334.html pageno: 2.

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.