Instructions for using the Apache AB tool for stress testing

Source: Internet
Author: User
Tags session id server port cipher suite

Instructions for using the AB tool

1. Install the AB tool command

sudo apt-get install apache2-utils

2.AB command parameter Description

Usage:ab [Options] [http[s]://]hostname[:p Ort]/path

Options are:

// Number of requests

- N requests number of requests to perform

Concurrency number

-c concurrency number of multiple requests to make

-t timelimit Seconds to max. Wait for responses

-B windowsize Size of TCP send/receive buffer, in bytes

Post file (with Post data), colleague set-T

-P postfile File containing data to POST. Remember also to Set-t

-U putfile File containing data to PUT. Remember also to Set-t

Set the content type header for post

-T Content-type content-type header for POSTing, eg.

' Application/x-www-form-urlencoded '

Default is ' Text/plain '

Printing troubleshooting information

-V verbosity how much troubleshooting info to print

-W Print out results in HTML tables

-I use HEAD 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

Set cookies

-C attribute Add cookie, eg. ' Apache=1234. (repeatable)

Set header row

-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

is a colon separated username and password.

-P attribute Add Basic Proxy authentication, the attributes

is a colon separated username and password.

-X Proxy:port ProxyServer and port number to use

-V Print version number and exit

-K Use HTTP KeepAlive feature

-D do not show percentiles 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

-R Don ' t exit on socket receive errors.

-H Display Usage information (this message)

-Z ciphersuite Specify SSL/TLS cipher suite (see OpenSSL ciphers)

-F Protocol Specify SSL/TLS protocol (SSL2, SSL3, TLS1, or all)

3. How to use

Run ab-n 100-c http://keketour.me/

the http://keketour.me/ The site makes 100 requests, and 10 requests concurrently

pressure Test Results

  1. Server software:lighttpd/1.4.20

  2. Server Hostname:www.meetu.hk

  3. Server port:80

  4. Document Path:/

  5. Document length:2095 bytes

  6. Concurrency level:10

  7. Duration of the entire test

  8. Time taken for tests:3.303 seconds

  9. Number of requests completed

  10. Complete requests:100

  11. Failed requests:0

  12. Write errors:0

  13. Total transferred:235200 bytes

  14. HTML transferred:209500 bytes

  15. Average of 30 requests per second

  16. Requests per second:30.27 [#/sec] (mean)

  17. //average per request processing time is 330 milliseconds Note: Here, 10 concurrent requests are considered as a whole  

  18. Time per request:330.335 [MS] (mean)

  19. Average processing time per concurrent request is 33 milliseconds

  20. Time per request:33.034 [MS] (mean, across all concurrent requests)

  21. Transfer rate:69.53 [Kbytes/sec] Received

  22. Connection Times (MS)

  23. Min MEAN[+/-SD] Median max

  24. CONNECT:51 170 35.9 178 230

  25. Processing:60 153 64.5 121 263

  26. Waiting:55 148 64.4 115 258

  27. TOTAL:235 322 59.9 299 437

  28. Percentage of the requests served within a certain time (MS)

  29. //50% of these 100 requests are completed in 299 milliseconds  

  30. 50% 299

  31. Of these 100 requests, 66% were completed in 312 milliseconds.

  32. 66% 312

  33. 75% 383

  34. 80% 412

  35. 90% 431

  36. 95% 432

  37. 98% 436

  38. 99% 437

  39. 100% 437 (Longest request)

Attention:

When simulating a login, you only need to set a cookie:

1. After logging in with your account and password, use the Developer tool to find the cookie value (session ID) that identifies the session.

2. If only one cookie is used, simply type the command:

ab-n 100-c 10-c jiang_token= 3820aab5-a395-48b2-8d2b-87bf47026e78

http://keketour.me/

If more than one cookie is required, set the header directly:

ab-n 100-h "cookie:key1=value1; Key2=value2 " http://keketour.me/

Test API interface (here is an example of adding a travel scheme)

ab-n 10-c 5-p/var/www/kkt/post.txt-v 3 - h "cookie:jiang_token=3820aab5-a395-48b2-8d2b-87bf47026e78; X-requested-with:xmlhttprequest " - t application/x-www-form-urlencoded" http://keketour.me/product/ Tourinfo/savetournameajax "

Where Post.txt is the post parameter text, the content is

name= Pressure Test Stroke Plan &tour_id=0&product_id=1382&_method=patch

Summarize:

AB Tool AB is small, simple, quick to learn, can provide the basic performance indicators needed, but no graphical results, can not be monitored. The AB tool can therefore be used as a temporary emergency task and as a simple test.


This article is from the "formerly Slow" blog, please be sure to keep this source http://onebig.blog.51cto.com/13006327/1981389

Instructions for using the Apache AB tool for stress testing

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.