JMeter Pressure Measurement website

Source: Internet
Author: User
Tags http file upload http post keep alive

1.Jmeter Introduction

JMeter is a Java-based stress testing tool developed by the Apache organization.

JMeter can be used to simulate huge loads on servers, network live objects, test their strength and analyze overall performance from different pressure categories. In addition, JMeter is able to perform functional/regression testing of the application by creating a script with assertions to verify that your program returns the results you expect. For maximum flexibility, JMeter allows you to create assertions using regular expressions.

2.Jmeter Working principle

image001

3.Jmeter Installation

Lab Environment:
System: centos6.6 64-bit
Java:1.8.0_65
jmeter:3.0
(1) Installing Java
Tar XF jdk-8u65-linux-x64.tar.gz-c/usr/local/
cd/usr/local/
Ln-s JDK1.8.0_65/JDK
echo "JAVA_HOME=/USR/LOCAL/JDK" >/etc/profile.d/java.sh
echo "Export path=\ $JAVA _home/bin:\ $PATH" >>/etc/profile.d/java.sh
source/etc/profile.d/java.sh
Java-version
(2) Installation JMeter
wget http://apache.fayea.com//jmeter/binaries/apache-jmeter-3.0.tgz
Tar XF apache-jmeter-3.0.tgz-c/usr/local/
cd/usr/local/
Ln-s Apache-jmeter-3.0/jmeter
(3) Run JMeter, need your remote tool support open graphical interface, I use Xmanager here
/usr/local/jmeter/bin/jmeter
JMeter opens after the page looks like this:


Add: If the Windows platform is running JMeter, it is also necessary to configure the Java environment, then download JMeter, unzip, run the JMeter installation directory under bin/ Jmeter.bat can, usually also a large part of the people in Windows configuration JMeter do the controller, Linux to do the press.

4.jmeter Pressure Measurement website

Test steps:
(1) test plan
(2) Thread Group
(3) HTTP request
(4) Listener
(5) Run the script
(6) View the report
1, the entire test is based on a test plan, test plan for testing, such as thread groups and HTTP requests are created on the basis of a test plan.

2. Add a group of threads

Number of threads: that is, how many threads are opened for testing
Ramp up period: How long does it take to set the number of virtual users to start all. If the number of threads is 20, the time is 10, which is to start 2 threads per second.
Number of cycles: the number of times each thread sends a request. If the number of threads is 20 and the number of cycles is 100, that each thread sends 100 requests. The total number of requests is 20*100=2000. If "Forever" is checked, all threads will continue to send the request and always choose to stop running the script.
Scheduler: Can be more flexible set run time, etc., must be set continuous pressure measurement for one hours, or pressure measurement day.

3. Add an HTTP request to the thread group


HTTP request Settings-leave the default:
Name: This property is used to identify a sampler and it is recommended to use a meaningful name
Note: For tests that do not have any effect, only the user records readable annotation information
The server name or the destination server name or IP address that the IP:HTTP request was sent.
Port number: The port number of the destination server, the default value of 80. The subsequent timeout definition can be used without filling in.
Protocol: The protocol that sends an HTTP request to the target server, either HTTP or HTTPS, with the default value of HTTP
Methods: Methods for sending HTTP requests, including GET, post, head, put, options, Trace, delete, and so on.
Content Encoding: Contents encoding method
Path: Destination URL path (excluding server address and port)
Automatic redirection: If this option is selected, JMeter automatically redirects to the new page when the response is 302/301 when the HTTP request is sent.
Use keep Alive: When this option is selected, HTTP communication is used keep-alive between JMeter and the target server, which is selected by default
Use Multipart/from-data for HTTP POST: When sending an HTTP POST request, it is sent by using the Multipart/from-data method, which is not selected by default.
Send parameters with the request: the URL parameter is sent in the request, and for the URL with parameters, JMeter provides a simple method for parameterization. The user can set all parameters in the URL in this table, each row in the table is a parameter value pair (the name name in the corresponding URL 1= value 1)
Send a file with the request: Send the file in the request, usually, the HTTP file upload behavior can be simulated in this way.
4. Adding listeners
View result trees and aggregated reports

5, run the test: Our test plan is set no problem, click the test Run button to start testing


6. View Test Results
Result tree: Here you can see the success and failure of each request, as well as the response data


Aggregation report: Mainly to view the response time of the request, error rate, concurrency per second, etc.

Parameter description: Unit is milliseconds
Label: Define the HTTP request name
Samples: Indicates how many requests were made in this test
Average: Average response duration-the average response time of a single request by default
Median: Median, which is the response time of 50% users
90% line:90% User's response duration
Min: Minimum response duration for access pages
Max: Maximum response time for access pages
error%: Number of bad requests/total number of requests
Throughput: By default indicates the number of requests completed per second (request per second)
Kb/sec: The amount of data received from the server side per second

JMeter Pressure Measurement website

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.