Performance Test-jmeter

Source: Internet
Author: User
Tags http cookie

Reason

In many cases, we write the process only to the fixed module to take the concurrency limit, and the ASP also has his own processing mechanism, especially for the focus on business, results-oriented team may pay more attention to a certain time node to give a satisfactory product, but your module in the end is robust, you have a mental spectrum? Tell me aloud is you sure? Let's look through a tool. He is jmeter!

(The final test found that the blog park visit some problems, the specific hope that the majority of the park friends to give guidance)

Basic IntroductionApache JMeter is a Java-based stress testing tool developed by the Apache organization. For stress testing of software, it was originally designed for Web application testing but later extended to other test areas. It can be used to test static and dynamic resources such as static files, Java applets, CGI scripts, Java objects, databases, FTP servers, and so on. JMeter can be used to simulate huge loads on servers, networks, or objects, testing their strength and analyzing overall performance from different pressure classes. 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.

Environment preparation

(1) JMeter is built in the Java environment, so your machine needs to install the Java environment, I like the Java Group of colleagues to a brief installation package, after installation needs to configure the environment variables.

(2) JMeter installation Package http://jmeter.apache.org/

Because the blog park on the upload file has a size limit, so ...

Java environment:

Jmeter:

Basic Concept Understanding

Test Plan

Thread Group

Each task in the test has to be thread-processed, and all our subsequent tasks must be created under the Threads group.

Logic Control Unit

Many different implementations can determine the order in which each sample is executed.

Sampling device

It can be assumed that all test tasks are taken by the sampler, and there are some, such as: HTTP requests.

Timer

The timer is used to set the wait time between operations, and the wait time is the hand side of the performance test commonly used to control the client QPS. Similar to the "Think Time" inside the LoadRunner. JMeter defines different types of timers, such as bean Shell Timer, Constant throughput timer, fixed timer, and so on.

Assertion

The result of the request returned by the sampler is judged correctly.

Configuring components

The configuration element (config Element) is used to provide support for static data configuration. The CSV data Set config can form a data pool for the local data file, while the configuration for the types of HTTP request sampler and TCP Request Sampler can modify the default data for sampler. (for example, HTTP cookie manager can be used to manage HTTP Request Sampler cookies)

Listener

Its function is to display the request result of sampler, statistic some data (throughput, kb/s ...) such as

Getting Started

Let's take a look at some examples of jmeter

Test Address: http://www.cnblogs.com/mongo/p/4623560.html

Scenario: Simulate user concurrent requests to view Web site load Parameters

(1) Run JMeter, install the Java environment, open the JMeter installation directory, run \apache-jmeter-2.13\bin\jmeter.bat

(2) Add thread Group

Description

Number of threads: We've configured 500 threads open

Ramp-up Period: Set to 0 indicates that 500 threads are started at the same time within 0 seconds

Cycle times: Overall execution once

(3) Setting the controller

Here we set the loop controller, each thread loops 5 times Sampler Operation

(4) Set Sampler Sampler

Here we use a blog park article address to do test, simple request page

(5) Add monitoring listener

In order to better see our test results, we need the appropriate graphical display, where we add graphical results and observation results tree

(6) Operating Results (6.1) Summary Report

Number of requests 2500

Average response Time 1185

Throughput: 175.8/s

(6.2) Graphical results

(6.3) Observation result tree

There seems to be a problem here, I visit the blog Park designated pages, the previous requests can be, and then the request has been time out state, over a period request again, there are currently 2 conjecture

(1) The blog Park has made restrictions, a certain address frequently send requests will be limited to a period of time?

(2) But obviously the number of successful start requests and the number of requests after a period of time is obviously different, is there really a problem with the program?

This is just speculation, specific people can also consider the exchange of guidance, this article is mainly to allow you to test a certain part of the load, introduced the basic use of jmeter, so that we have a quantitative understanding of their own modules, in the writing process will be more thinking.

Performance Test-jmeter

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.