JMeter Basics: Simple Performance testing

Source: Internet
Author: User
Tags http request thread

In the previous section, we learned about one of the major components of jmeter, so how are these components used in performance testing? This section creates a simple test plan to use these components. The program corresponds to the test requirements.

1 Test target site is fnng.cnblogs.com and tt-topia.rhcloud.com

2 The purpose of the test is the response time of the website when the load reaches QPS.

QPS explanation

Qps:query per Second query rate. is the number of queries a query server can process per second. On the Internet, the performance of a server as a domain Name system is often measured by the query rate per second.

In order to achieve the desired testing purpose, a test plan needs to be established in the JMeter. Because this test only requires completion of the fnng.cnblogs.com and tt-topia.rhcloud.com two blog first page request, so only need to use the HTTP request sampler.

Establish a test plan

When JMeter is started, JMeter automatically generates an empty test plan that allows users to build their own test plans based on the test plan.

Adding thread groups

A performance test request load is done based on a thread group. A test plan must have a thread group. The test plan is simple to add a thread group. Select a thread group in the test plan by right-clicking the Drop-down menu (add-->threads (Users)---> Thread Group).

Each test plan in JMeter needs to contain at least one thread group, and of course you can create multiple thread groups in one plan, so what is the sequential execution (serial or parallel) between multiple thread groups? Under the test plan, multiple threads are executed in parallel, meaning that the thread groups are initialized simultaneously and execute the sampler under the thread group.

The thread group consists primarily of three parameters: the number of threads, the length of preparation (ramp-up Period (in seconds)), and the number of loops.

Number of threads: number of virtual users. A virtual user occupies a process or thread. How many virtual users are set here is the number of threads set.

Preparation Length: The number of virtual users that will be set to start all at a time. If the number of threads is 20 and the preparation time is 10, it takes 10 seconds to start 20 threads. That is to start 2 threads per second.

Number of cycles: the number of times each thread sent a request. If the number of threads is 20 and the number of loops is 100, then each thread sends 100 requests. The total number of requests is 20*100=2000. If "Forever" is checked, then all threads will always send a request, one to choose to stop running the script.

Setting a reasonable number of threads has a decisive effect on whether or not the test target can be achieved. In this example, the request to get the home page in the QPS load case response time, if the number of threads set too small, it is likely that the set of QPS requirements can not be achieved. In addition, it is also important to set a reasonable number of cycles, in addition to the fixed number of cycles described above and forever, you can also flexibly choose to set the test run time. Check "Scheduler" for scheduler configuration.

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.