Performance test study notes (20201126)

Other performance testing tools

wrk benchmark tool

  • wrk is an open source, HTTP protocol benchmarking tool
  • Benchmark test: refers to the realization of a quantitative and comparable test of a certain performance index of a class of test objects by designing scientific test methods, test tools and test systems

Features:

  • High concurrency and low resource consumption
  • Simple installation and deployment
  • Primitive support LuaJIT script
  • But: Not suitable for performance testing of multiple protocols and complex scenarios

wrk install

  进入文件夹>> make

Verification: ./wrk -v View version information
1. Install git : yum install git -y
Insert picture description here
git clone https://gitee.com/mirrors/wrk.git
gitee.com website: Code Cloud
Insert picture description here

  • 2. Enter the wrk folder
    Insert picture description here
  • 3. Rely on gcc, then make, install gcc: yum install gcc -y, the following figure shows that the installation is complete
    Insert picture description here
  • 4. View version information: ./wrk -v
    Insert picture description here

wrk walkthrough

1. Get request, explanation: .wrk/ -t 10 -c 100 -d 10s https:www.baidu.com
means: simulate 10 clients to establish 100 connections in 10 seconds and visit Baidu
Insert picture description here

Insert picture description here

  • 6. POST request
  • First create a data.lua file: vi data lua
  • Enter in the file:
    wrk.method="POST"
    wrk.headers["Content-Type"]="application/json"
    wrk.body="{"mobilephone":"18874147777","pwd":"123456"} "
  • ./wrk -t 4 -c 100 -d 60s ./data.lua --latency http://192.168.00.000:8080/app/mobile/api/user/login
  • Then execute: ./wrk -t 4 -c 100 -d 60s -s ./data.lua --latency http://192.168.00.000:8080/app/mobile/api/user/login
    Insert picture description here

ab performance test

ApacheBench(ab)

Released with apache, free and open source. It
is a single-threaded command line tool for measuring http server performance

  • Features

    Small and flexible, quick to learn and get started,
    powerful statistics function
    But: can't do complex script development, no graphical interface, can't do monitoring

ab install
Install
centos: sudo yum -y install httpd-tools
Ubuntu: sudo apt-get -y install apache2-utils
Insert picture description here

Verify
ab -V: view the version number
Insert picture description here

ab --help: Get help information,
Insert picture description here
ab parameter options,
Insert picture description here
ab exercises,
Insert picture description here
Insert picture description here
Insert picture description here
wrk initiates more pressure, ab initiates less pressure

ngrinder

  • nGrinder is a very easy-to-use, powerful stress testing tool with a simple and friendly user interface and a controller-agent distributed structure. Its script supports Jython and Groovy languages
  • It consists of a Controller and multiple Agents connected to it. The user manages and controls the test through the web interface, and views the test report
    Insert picture description here
    . Upload the two packages as shown below.
    Insert picture description here
    Determine the firewall status: systemctl status firewalld
    Unzip Tomcat: tar -xzvf apache-tomcat-8.5.50.tar.gz
    Insert picture description here
    Copy the ngrind.war package to
    Insert picture description here
    Open the service in tomcat's webapps folder : http://192.168.30.135:8080/ngrinder-controller-3.5.2
    Insert picture description here

Insert picture description here
Insert picture description here

If there are multiple tomcats in the computer, look for vim, and if there is no vim, install vim: yum install vim -y, and then use the vim server.xml command to check the port
Insert picture description here
Insert picture description here

If the port is occupied, the port number can be changed directly Insert picture description here
after opening the service, log on to download proxy
Insert picture description here
upload agent, extract the tar package
Insert picture description here
to view agent and other documents
Insert picture description here
proxy management can see their machines
Insert picture description here
Insert picture description here
ngrinder create a script
Insert picture description here
and performance testing, set the parameters, select Change created Script

Insert picture description here

Guess you like

Origin blog.csdn.net/mbrs_311723/article/details/112965085