Reprint: Http://www.cnblogs.com/TankXiao/p/4059378.html?utm_source=tuicool
JMeter is a very useful tool for stress testing. JMeter is designed to be a lightweight stress test, and it takes only more than 10 minutes to write the scripts needed for stress testing.
What is a stress test?
As the name implies: The pressure test, is the system under test, under certain access pressure, see whether the program is stable/stable server operation (Resource usage)
For example: 2000 users at the same time to a shopping site shopping, these users can open the page is slow, or whether the site will collapse
A common tool for stress testing
Do stress test, generally use tools, manual is no way to do. The most commonly used tool is LoadRunner, but LoadRunner is a fee-paying software, and is more complex to use. Now more and more people are starting to use JMeter to do stress tests. It's free and very simple to use.
The steps to do the stress test are as follows:
1. Writing scripts or recording scripts
2. Using user-defined parameters
3. Scene Design
4. Use the controller to control how many users are impersonating.
5. Use the Listener to view test results
This article is an example of stress testing
This article gives an example of using JMeter to simulate 200 users on a single computer, and to use Bing to search for different keywords to see if the time returned by the page is within the normal range.
First step: parameterize using CSV Data Set Config
First, we put the 2 parameters needed for the test in the TXT file,
Create a new Data.txt file, enter some data, a row with two data, separated by commas.
Start JMeter, add a thread Group first, and then add a CSV Data set config (Add, config Element, CSV data set config)
Step two: Add the HTTP Request.
We add HTTP requests, send get to http://cn.bing.com/search?q= Blog Park + Small Tank
Select the thread Group right (Add->sampler, HTTP Request) to fill in the following data:
Step three: Use the thread Group to control how many users are impersonating
Select the thread Group
Number of Threads (users): One user takes one thread, 200 threads is impersonating 200 users
Ramp-up Period (in seconds): Sets how long the thread will take to start all. If the number of threads is 200 and the preparation time is 10, then 1 seconds will be required to start 20 threads. That is, starting 20 threads per second.
Loop Count: The number of times each thread sent a request. If the number of threads is 200 and the number of cycles is 10, then each thread sends 10 requests. The total number of requests is 200*10=2000. If "Forever" is checked, all threads will continue to send the request until you choose to stop running the script.
Fourth Step: Add summary Report to view test results
Check the thread Group right (ADD-Listener, Summary report)
Fifth step: Run a bit
So far, the script is all written, let's run, how to look at the results of the test
JMeter Tutorial Simple Stress test