Installation and combat of Linux under siege

Source: Internet
Author: User

I. Installation of siege
    1. Download the latest version of siege

      wget http://download.joedog.org/siege/siege-latest.tar.gz
    2. Unzip and enter the siege path

      tar -zxvf siege-latest.tar.gzcd siege-*/
    3. If you do not have the build tool installed, first install

      sudo apt-get install build-essential
    4. Compiling the installation

      ./configuremakesudo make install
    5. Creating a configuration file

      siege.config
    6. Modifying a configuration file
      Open the ~/.siege/siege.conf file, modify the logfile option

      logfile = $(HOME)/siege.log

      Open Siege-h See if the installation is successful, open siege-h can see the parameters of siege

Two. Siege combat
  1. Siege Common parameters
    • -c specifies concurrency
    • -R Specifies the number of repetitions
    • -D Specifies the delay time for the request, and note that the random delay between each request
    • -f Specifies a URL list that can be given to multiple Site pressure
    • -t Specifies the use case execution time, such as-T 10s -t 1M (H) and so on
    • -G Get the requested headers information and print it, debug dedicated
    • -h Specifies the requested headers information
    • -L or--log=[file] Specifies the path of the test result
  2. Requirement 1: Use siege to pressurize multiple pages
    Use siege to pressurize multiple pages, and the concurrency number is 5, run 1 minutes

      page url:http://ur.tencent.com/ Categories/7http://ur.tencent.com/categories/7/?page=2http://ur.tencent.com/categories/7/?page=3  

    On the virtual machine Ubuntu access to the above three connections, the number of concurrent is 5, continuous running 1 minutes

      [email protected]:~/test$ siege-c 5-t 1m-f url.txtlifting the server siege ... done. transactions:345 hitsavailability:100.00%elapsed time:59.73 secsdata transferr             ed:1.88 mbresponse time:0.36 secstransaction rate:5.78 trans/secthroughput: 0.03 mb/secconcurrency:2.10successful transactions:345failed Transactions:0longe St Transaction:27.16shortest transaction:0.21  
  3. Requirement 2: Save siege log
    Save the log in Result.csv and open the Result.csv

    [email protected]:~/test$ siege -c 5 -t 1M -f url.txt --log=result.csv[email protected]:~/test$ more result.csv   Date & Time,  Trans,  Elap Time,  Data Trans,  Resp Time,  Trans Rate,  Throughput,  Concurrent,    OKAY,   Failed2018-02-07 04:10:10,    160,      59.30,           0,       0.35,        2.70,        0.00,        0.95,     160,       4
  4. Requirement 3: Enable gzip compression at time of pressure measurement
    Accept-encoding is set to gzip, and the log is saved in Result_gzip.csv and opened Result_gzip.csv

    [email protected]:~/test$ siege -c 5 -t 1M -f url.txt -H "Accept-Encoding:gzip" --log=result_gzip.csv[email protected]:~/test$ more result_gzip.csv   Date & Time,  Trans,  Elap Time,  Data Trans,  Resp Time,  Trans Rate,  Throughput,  Concurrent,    OKAY,   Failed2018-02-07 04:22:44,    197,      59.83,           1,       0.35,        3.29,        0.02,        1.14,     197,       3
  5. Requirement 4: Pressure measurement on mobile site
    Set User-agent as iphone to server

    [email protected]:~/test$ siege -c 1 -r 1 -A "Apple-iPhone5C2/1001.525" http://www.baidu.comTransactions:                  1 hitsAvailability:             100.00 %Elapsed time:               0.09 secsData transferred:           0.00 MBResponse time:              0.08 secsTransaction rate:          11.11 trans/secThroughput:             0.01 MB/secConcurrency:                0.89Successful transactions:           1Failed transactions:               0Longest transaction:            0.08Shortest transaction:           0.08

Installation and combat of Linux under siege

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.