Test web site for high concurrency access pressure

Source: Internet
Author: User
Tags http post

Test web site for high concurrency access pressure

JMeter website Concurrency test

Apache 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 to test their strength and analyze overall performance under 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.

1. Download JMeter

official website Download latest version:  http:// jmeter.apache.org/download_jmeter.cgi

English bad friend :


2. Start JMeter

Words do not say, Direct: first decompression apache-jmeter-2.9, into the bin directory: click Jmeter.bat. Start the Software


Start interface:



1)establishes a thread. To simulate multiuser access: the steps are as follows



Why set up thread groups? 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 are started, such as: What I'm filling out here is 10,ramp-up Period (in seconds), which indicates how much time interval between threads is allowed, 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 Complete is one time, the number of cycles is such a request process how many times, I am here to fill out the test is 2. Do not forget to save once you have modified one setting.

2) Set up the request server, pressure link and other information

The next thing is, naturally, what is the address of the website we're testing? What is a link? So now we're going to set up this information. Right click on the thread group we just created, in the popup menu, choose Add->sampler->http request, popup like interface:



Path:

If you are just a stress test on a link, just fill in a link to OK, such as HTTP// Www.baidu.com, but in most cases this is not the case, we need multiple links here, as we have just started, we want to save multiple links to a text file, and then randomly read the stress test. We can do this,


Select _stringfromfile in the Select a feature drop-down list and create a new test file on this machine C:\Users\root\Desktop\apache-jmeter-2.9\ Test.txt, fill in the path to the test file in the first row (you can also not be in the first row), such as:


Then click on the "Generate" button and a string will be generated in the left text box of the Generate button, such as:

${__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 Test.txt is the relative address;


This way, when we are not requesting it, we randomly select URLs from Test.txt for stress testing.

Another notable place is that if the parameters in the case of Chinese, the runtime may be garbled, this time you need to note that your encoding settings in the JMeter and the page encoding you want to request is consistent.

The options below the path text box can be made by default, and use Multipart/form-data for HTTP post is the case when there is an attachment in the request, which is not normally checked

3) View running results

Right-click on the thread group, and in the pop-up menu, choose Add-and-listener, using the table query results, such as:




The properties are as follows:

  • Sample: Ordinal of each request
  • Start time: The start of each request
  • Thread Name: Name of each thread
  • Label:http Request Name
  • Sample time: Per request, in milliseconds
  • Status: The request state, if the tick indicates success, if the fork represents a failure.
  • Bytes: Number of bytes requested

Here are a few more parameters :

  • Number of samples: that is, the number of requests mentioned above, the success of the case equals the number of concurrent numbers you set multiplied by the number of cycles
  • Average: Average time requested by each thread
  • Latest Sample: Indicates when the server responded to the last request
  • Deviation: The size of the server response time change, the degree of dispersion measurement.

Here, we have done a simple web site concurrency test. There are other functions, their own research and research

Test web site for high concurrency access pressure

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.