JMeter website Concurrency test

Source: Internet
Author: User
Tags http post first row time interval
Original: http://blog.csdn.net/zhang_ps/article/details/51345904

jmeter website concurrency test

The Apache JMeter is a Java based stress testing tool developed by the Apache organization. Used for stress testing of software, which 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 a huge load on servers, networks, or objects to test their strength and analyze overall performance under different stress 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 the use of regular expressions to create assertions. More do not say: direct operation: Because the JMeter is developed using Java, so the operation requires a Java operating environment. People who have touched Java know that the Java environment is built, not what we are talking about, so will not, their own degrees Niang ha.

1. Download JMeter

The official website downloads the latest version: HTTP://JMETER.APACHE.ORG/DOWNLOAD_JMETER.CGI, English, you know.

English bad friend: http://www.quzhuanpan.com/home/sourceList.jsp?type=6, Chinese download address


2. Start JMeter words, directly on the map: first decompression apache-jmeter-2.9, into the bin directory: click Jmeter.bat. Start software


Start interface:



1) Establish the thread. Simulate multiuser access: steps below



Why do you want to set up a thread group? The reason is simple, because we want to simulate multiple threads (users) to access the Web site. In the Thread Properties section, the number of threads is how many threads to start, for example: I am filling out here is 10,ramp-up Period (in seconds) indicates how much time interval between threads allow, in seconds, for example, if you fill in 10, then 10/10= 1 indicates that the Web site is requested every 1 seconds between 10 threads. Number of cycles: 60 threads Run is one time, the number of cycles is such a request process to run how many times, I test here to fill out is 2. Every time you modify a setting, don't forget to save it.

2 Set the request server, the pressure link and so on information

And then, naturally, we're going to test the website address. What the link is. So now we're going to set this information. Right-click the thread group we just created, in the menu that pops up, select Add->sampler->http request, pop up the following image interface:



Path:

If you're just doing a stress test on a link, just fill in a link and it's OK, like http:// Www.baidu.com, but not in most cases, we need multiple links here, and as we've just started, we're going to save multiple links to a text file and randomly read the stress tests. We can do this, as shown in figure:


Select _stringfromfile in the Select a feature Drop-down list, and then create a new test file on this computer C:\Users\root\Desktop\apache-jmeter-2.9\ Test.txt, fill in the path of the test file in the first line (you can also not be in the first row), as shown in the following figure:


Then click the Build button and a string will be generated in the text box to the left of the build button:

${__stringfromfile (C:\Users\wukong\Desktop\test.txt,,,)}

In the Test.txt test file, we write a URL link for each line, in the following format:

If the address is: www.quzhuanpan.com. So. The content in the Test.txt is the relative address;


This way, when we are not asking, we randomly select URLs from the Test.txt to do the stress test.

Another noteworthy place is that if there are Chinese in the parameters, the runtime may appear garbled, this time you need to pay attention to your jmeter in the code settings and you want to request the page code is the same.

The options below the path text box, which can be made by default, use the Multipart/form-data for HTTP post when there is an attachment in the request, usually without the selected 3 to view the results of the Run

Right-click the thread group, in the pop-up menu select Add-> listener-> query results, as shown below:




The properties are as follows: Sample: Per request ordinal start time: Per request start thread name: Label:http request name for each thread Sample time: Each request is spent in milliseconds, the status: request State, If the check indicates success, if the fork represents a failure. Bytes: Number of bytes requested

Here are a few more parameters: number of samples: that is to say the number of requests, the success of the case is equal to the number of concurrent cycles you set multiplied by the average: the average time per thread request the latest sample: Indicates the time deviation of the server response to the last request: The server response time change, the size of the discrete measure.

Here, we have done a simple website concurrency test. There are other functions, you can fathom it, hehe.




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.