Today, pressure testing of a bit from
Is there a good article, the original author unknown
Tools AB (Apache Benchmark). In the Apache bin directory.
Format:. And Down [options] [http://] hostname [: port] / path
Parameters:
N-requests number of requests for implementation
/ / Executed in the test session in the number of requests. By default, only the execution of a request
to make C-parallelism Number of multiple requests
/ / A number of questions generated. The default value is one at a time.
T-timeout Seconds to max. Waiting for answers
/ / Tests for the maximum number of seconds. Implied value of the internal n-50ዀth It can test the server within a prescribed period all the time. By default, no time limit.
-P postfile data on file with POST
/ / POST data contains the necessary files.
T-content-type header Content-type for new posts
/ / POST data using the Content-Type header.
to-V print detail how much troubleshooting info
/ / Set the level of detail to display information – 4 or higher value will be the first message, 3 or more values response code (404, 200, etc.), two or more values can be displayed to display warnings and other information display be. V-display output version information and exit.
W printouts of the results in HTML tables
/ / To output HTML table format. By default, there is a white background, the width of a table 2
HEAD-I use instead of GET
/ / Implementation of the HEAD request instead of GET.
X-String attributes to insert as table attributes
/ /
Y-attributes String to insert attributes such as tr
/ /
Z-string attributes, insert as td or th attributes
/ /
C attribute Add cookie, for example. ’Apache = 1234 (Repeatable)
/ / C cookie-name = value on the requirement for a Cookie: line. The typical form of a parameter name = value pair. This parameter can be repeated.
H attribute Add Arbitrary header line, eg. ”Accept-Encoding: gzip”
Inserted all normal header lines. (Repeatable)
A attribute Add Basic WWW Authentication, the attributes
be a colon separated user name and password.
-P attribute Add Basic Proxy Authentication, the attributes
be a colon separated user name and password.
to trust / / P-proxy-auth username: password for a transfer agent for the Basic authentication.Username and password separated by a:, and send a base64 encoded form. Regardless of whether the server (that is, whether a ᑑ Authentication required to send), that string will be sent.
to use X-Proxy: Port proxy server and port number
-V print version and exit
Use HTTP KeepAlive feature K
Do not show percentiles served-D table.
-S not show confidence estimators and warnings.
G-gnuplot output filename format to collect data file.
E-output filename CSV file with percentages served
H-Display usage information (this message)
/ / String attributes attribute set. Defect processes in different static buffer declared fixed length.In addition, command-line parameters, the server’s response headers and other external input resolution is also very simple, can have negative effects. It is not clear HTTP/1.x accept, only certain “desired” response format. strstr (3) the frequent use can be a performance problem that is, you can when considering the benefit, instead of being the server.
Many parameters, usually we use the C and N parameters to it. For example:
. / Ab-C-1000 n 1000 http://127.0.0.1/index.php
This indicated that during the processing of the application and run 1000 1000 index.php.
# / Usr/local/xiaobai/apache2054/bin/ab-c 1000 n 1000 http://127.0.0.1/index.html.zh-cn.gb2312
This is Apache Bench, Version 2.0.41-dev <$ Revision: 1.121.2.12 mce_markergt; apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (patience)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 9Ǡ requests
Finished 1000 requests
Server Software: Apache/2.0.54
/ / Platform Version 2.0.54 apache
Server Hostname: 127.0.0.1
/ / Server host name
Server Port: 80
/ / Server port
Document Path: / index.html.zh-cn.gb2312
/ / Test-page document
Document Length: 1018 bytes
/ / Document Format
Concurrency Level: 1000
/ / The number of simultaneous
Time taken for tests: 8 seconds
/ / Duration of test
Complete requests: 1000
/ / Number of requests completed
Failed requests: 0
/ / Number of failed requests
Typo: 0
Total transferred: 1361581 bytes
/ / The scene of the network throughput
HTML transferred: 1055666 bytes
/ / The scene of the HTML content delivery capacity
Requests per second: 122.12 [# / sec] (mean)
/ / We are the most concerned about one of the indicators, the number of LR corresponds to the second transaction, in parentheses, that this is an average
Time per request: 8188ቁ1 [ms] (mean)
/ / We are mostly on the mean of the two indicators, the equivalent of LR in the average transaction response time, in brackets, that relevant to what is an average
Time per request: 8.189 [ms] (mean across all concurrent requests)
/ / The actual duration of the application, on average,
Rate: receive綢.30 [Kbytes / sec]
/ / Average network traffic per second, can help negate the existence of an excessive network-flow problems led to extended response
Connection Times (ms)
min mean [+ /-SD] median max
Connect: 4 646 1078.7 89 3291
Processing time: 165 992 4712 938 493.1
Waiting: 118 934 4554 882 480.6
Total: 813 1638 1338 1093 7785, 9
/ / Time spent on the network decomposition is not the data from the specific algorithm is very clear
Percentage of requests served within a certain period (ms)
50% of 1093
66% in 1247
75% in 1373
80% of 1493
4061 90%
95% 4398
98% 5608
99%
100% 7785 (longest request)
/ / The scene in response to all inquiries. In the scene has a response time of each request, of which 50% of the users response time of less than 1093 ms, 60% of the users response time of less than 1247 milliseconds, the maximum response time of less than 7785 ms
As for the complicated question, CPU is not really the same, but each request was in accordance with the time slice-by-cycle treatment, so basically the first time per request meets a second time per request in time multiplied by the parallelism of the number of requests



Posted in
Tags: