WebPressure Tool for Web under Linux: ApacheBench and WebBech Shaped Ddos Attack

Web-based performance measurement tool for Linux: ApacheBench and WebBench

 

1. ApacheBench

ab Pressure measurement tool installation

ab is a performance test tool for apace, which can be installed only with ab tools to support the https and https web pages. Ubuntu installs:sudo apt-get -y install apache2-utils

CentOS installation:sudo yum -y install httpd-tools

 

ab Detailed explanation of parameters

Format: ab [options] [http[s]://]hostname[:port]/path Example: ab-n 1000-c 100 https://mimvp.com/

Parameters:

  • -n The number of requests executed in the test session. Default only one request is executed.
  • -c Number of requests generated at a time. Default is one request at a time; in the case of 100, it means that 100 requests are made together.
  • -t The maximum number of seconds to be tested. The internal value is –n 50000, which limits the server test to a fixed total time period. There are no time limits for default.
  • -p contains documents that require POST data.
  • This string is sent regardless of whether the server needs it (i.e., has sent 401 authentication requirements code).
  • -The information on the Content-type header used in TPOST data.
  • -v Sets the level of detail to display information -4 or greater, the header is displayed, the response code (404,200, etc.) can be shown 3 or more, and warnings and other information can be shown 2 or more.
  • -V shows the version number and exits.
  • -w Output results in HTML format. By default, it is a table of the width of two columns of the white background.
  • -I execute the HEAD request, not the GET.
  • -x sets the string of properties.
  • -X uses proxy servers for requests.
  • -y sets the string of properties.
  • -z sets the string of properties.
  • -C Attach a Cookie to the request: Line. It is typically in the form of a parametric pair of name =value, which can be repeated.
  • The typical form of this parameter is a valid headline containing field and value separated by colon (e.g., “Accept-Encoding:zip/zop; 8bit”).
  • This string is sent regardless of whether the server needs it (i.e., has sent 401 authentication requirements code).
  • -h displaying the method of use.
  • -d Not Showable [ms] Message from table (support for previous editions).
  • -e Generates a comma-separated (CSV) document that contains the corresponding percentage time (in subtle units) required to process each corresponding percentage (from 1 per cent to 100 per cent). This format is more useful than `gnuplot’ because it is already “bidified”.
  • -g writes all the tests into a `gnuplot’ or TSV (separated from Tab). This file can easily be imported into Gnuplot, IDL, Mathematica, Igor and even Excel.
  • -I execute the HEAD request, not the GET.
  • -k Enables HTTP KeepAlive, which is to execute multiple requests in a HTTP session. The KeepAlive function is not enabled by default.
  • -q If the number of requests processed is greater than 150, ab will export a progress count at Stderr for each request that is handled by about 10 or 100. This-q mark can inhibit this information.

 

Full Help Document(English)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
[root@mimvp-bj script]# ab -h
Usage: ab [options] [http[s]://]hostname[:port]/path
Options are:
    -n requests     Number of requests to perform
    -c concurrency  Number of multiple requests to make at a time
    -t timelimit    Seconds to max. to spend on benchmarking
                    This implies -n 50000
    -s timeout      Seconds to max. wait for each response
                    Default is 30 seconds
    -b windowsize   Size of TCP send/receive buffer, in bytes
    -B address      Address to bind to when making outgoing connections
    -p postfile     File containing data to POST. Remember also to set -T
    -u putfile      File containing data to PUT. Remember also to set -T
    -T content-type Content-type header to use for POST/PUT data, eg.
                    'application/x-www-form-urlencoded'
                    Default is 'text/plain'
    -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
    -C attribute    Add cookie, eg. 'Apache=1234'. (repeatable)
    -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.
    -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.
    -q              Do not show progress when doing more than 150 requests
    -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
                    (SSL3, TLS1, TLS1.1, TLS1.2 or ALL)

 

POST Request

### post data 文件 user_login 内容: {"email":"[email protected]","password":"mimvp.com"}

ab -n 100 -kc 10 -p user_login -T 'application/json' -H 'Accept-Encoding:gzip, deflate' -H 'accept-language:zh-Hans-CN;q=1, en-CN;q=0.9' https://mimvp.com/usercenter/login

Parameter description:

-n 100  100 requests indicated

-kc 10  Means keep HTTP KeepAlive with 10 requests

-p user_login Document(s) requested by POST, json data format, as above {"email":"[email protected]","password":"mimvp.com"}

-T 'application/json'  Font-type header information used for POST data

-H 'Accept-Encoding:gzip, deflate'  Expressing a request for additional header information, web compression algorithm

-H 'accept-language:zh-Hans-CN;q=1, en-CN;q=0.9'  Expressing a request for additional header, web code

https://mimvp.com/usercenter/login  The website indicating the request, such as the home page of Mi-Potech

 

GET Request

ab -n 1000 -c 100 https://mimvp.com/

Run results are as follows: Completed 1000 requests Financed 1000 reQuests Server Software: nginx Server Hostname: mimvp.com Server Port: 443 SSL/TLS Protocol: TLSv1.2, ECDHE-RSA-AES128-GCM-SHA256, 2048, 128 Document Path: /Document Lenth: 16740 bytes// Page Size Concurency Level: 100/// and Times taken for bests: 295.766 seconds/ Total consumption times Failed requests: 141 / failed requests, mainly SSL connections, mostly SSL certificate failures (Connect: 0, Access: 0, Length: 141, Express: 0) Writers: 0 Non-2 x transmissions: 8 Total requests: 1470512 bytes // total transfer bytes, including headline information at http: 14550084 bytes / html bytes and actual page delivery numbers Time per request: 29576.594 [ms] (mean) / Each request is time-consuming, as 100 requests are issued at a time and therefore each combined time required to be divided by 100 Time per request: 295.766 [ms] (mean, ascross all concurrent requests) / / Time request: 48.70 [Kbytes/sec] received / Data length obtained per second 50% 14579 #50% returns within 14579m 66% 21043 #66% returns within 21043m 75% 26262 80% 30834 90% 52050 95% 65124 98% 79861 99% 89688 100% 130547 (longest request)

mimvp-201709-06

 

When tested, you can use it on the tested server.htopCommand to view real-time usage of CPU and memory: htop installation: sudo yum-y install htop

mimvp-tech-web-wang-ye-xing-neng-ya-ce-gong-ju-01

 

 

2. WebBench

WebBench can simulate up to 30,000 co-connections to test the load capacity of the site.

Mipo believes that WebBench is better and easier to install than the ab-pressure test tool he brought himself with Apache.

Web Bench is very simple tool for benchmarking WWW or proxy servers. Uses fork() for simulating multiple clients and can use HTTP/0.9-HTTP/1.1 requests. This benchmark is not very realistic, but it can test if your HTTPD can realy handle that many clients at once (try to run some CGIs) without taking your machine down. Displays pages/min and bytes/sec. Can be used in more aggressive mode with -f switch.

WebBench Network:http://home.tiscali.cz/~cz210552/webbench.html

 

1) Preparatory work

yum -y install ctags wget make apr* autoconf automake gcc gcc-c++

 

2)WebBench Download installation

wget http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz

tar zxvf webbench-1.5.tar.gz
cd webbench-1.5
make && make install

 

3) WebBench Parameter Meaning

[root@mimvp-bj script]# webbench -h
webbench [option]… URL
-f |–force               Don’t wait for reply from server.
-r |–reload              Send reload request – Pragma: no-cache.
-t |–time <I don’t know, sec.>          Run benchmark for <I don’t know, sec.> seconds. Default 30.
-p |–proxy <server:port> Use proxy server for request.
-c |–clients <I don’t know.>         Run. <I don’t know.> HTTP clients at once. Default one.
-9 |–http09              Use HTTP/0.9 style requests.
-1 |–http10              Use HTTP/1.0 protocol.
-2 |–http11              Use HTTP/1.1 protocol.
–get                    Use GET request method.
–head                   Use HEAD request method.
–options                Use OPTIONS request method.
–trace                  Use TRACE request method.
-? |-h|–help             This information.
-V |–version             Display program version.

 

4)WebBench Example:

[root@mimvp-bj script]# webbench -c 500 -t 30 http://mimvp.com/
Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.

Benchmarking: GET http://mimvp.com/
500 clients, running 30 sec.

Speed=12348 pages/min, 73882 bytes/sec.
Requests: 6174 susceed, 0 failed.

mimvp-201709-07

Parameter description:

-C500 indicates 500 simultaneous connections at the same time -t 30 indicates duration of request

 

Calculating the time taken for each request: Seconds / Requests = 30 / 6174 = 4.86 ms/

 

 

nginx support http2

See Module ngx_http_v2_moduleAdd the compilation parameters – wit-http_v2_module http2_mudule http2 needs a browser to work with, as follows: ./configure-user=www-group=www-prefix=/usr/local/nginx –with-http_stub_status_module-with-http_v2_module http2, both Chrome and Firefox have already supported http2 and http2 for 2015: http2 http2According to https.https://mimvp.com   Or the rice collection of wealth: https://mimji.com

1) FireFox FireFox Viewer

Browser Opens the Mi-Pop technology front page https://mimvp.com —> F12 Developer Tool ->  Network -> Headers, the following figure

let-s-encrypt-jia-mi-ssl-zheng-shu-bing-qiang-zhi-qi-yong-https-fang-wen-31

 

2)Chrome Google Browser View

Open link:chrome://net-internals/#http2

let-s-encrypt-jia-mi-ssl-zheng-shu-bing-qiang-zhi-qi-yong-https-fang-wen-32

With the upgrading of server hardware and software, the Mi-po technology and its products have become available at https.

未经允许不得转载:萌萌Apprentissage » WebPressure Tool for Web under Linux: ApacheBench and WebBech Shaped Ddos Attack

Like (0) 打赏

Comments 0

Protected with IP Blacklist CloudIP Blacklist Cloud
  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

//下一个脚本特效
//下一个脚本