JMeter Distributed pressure measurement

Source: Internet
Author: User

First, the premise:

3 Servers, IP: A, B, C, respectively

Operating system: not limited to (Windows\linux all)


Second, the operation steps:

1. Install the Java Runtime Environment on 3 servers, JDK 1.6 or higher


2. Configure the Java environment variables separately

Under Windows:


New variable:

Variable name: ClASSPATH variable value:,;%java_home%\lib\dt.jar;%java_home%\lib\tools.jar;

Variable name: Java_home Variable Value: The installation path of the JDK, such as C:\Program files\java\jdk1.6.0_26

Path already exists, modified can be variable name: path, before the value of the existing variable added:%java_home%/bin;%java_home%/jar/bin;


To detect whether the configuration was successful:

Finally, running Javac, Java, and java-version in cmd, if printed correctly, indicates that the Java configuration is successful.


Linux is to modify the /etc/profile file and add the following text:

export java_home=/usr/share/jdk1.6.0_14  (installation directory)
export path= $JAVA _home/bin: $PATH  

Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar


3. Copy the JMeter installation package to any directory of 3 machines

such as: Download Jmeter-2.13 version from the official website, Apache-jmeter-2.13.zip, unzip it, place the D packing directory (everywhere)

Note: Each server installs the version to be consistent, uses the jar also to be consistent, otherwise will error;


4. Assume that set A is Ctroller,b, C is the agent

Windows environment, you need to modify the jmeter of a in the bin directory of the jmeter.properties in the Remote_hosts,linux is not

such as: remote_hosts=127.0.0.1,192.168.60.243:1099,192.168.60.212:1099

which

A. If the machine is also involved in concurrent, then write 127.0.0.1, otherwise do not use;

b.192.168.60.243 and 192.168.60.212 are the IP of B and C respectively;

c.1099 is the default port number;

D. Separated by commas between IP


5. Configure the test plan

Use GUI mode to edit test plan and save as JMX file under Windows

Note:

If you are running under Linux, do not add any listeners, only write files at the Run command

Windows, you can also just add simple Data writer listener, specify the path, remove other listeners, consumes less resources


6. Start the service

Windows, A, B, C are started Jmeter-server.bat, if a only as controller does not participate in concurrent, then do not start;

Linux, A, B, C are started Jmeter-server, if a only as controller does not participate in concurrent, then do not start;


7. Execute the Script

Under Windows, click Run->remote Start All, or the shortcut icon 650) this.width=650; "Src="/e/u261/themes/default/images/spacer.gif " Style= "Background:url ("/e/u261/lang/zh-cn/images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= " Spacer.gif "/> if you want to execute a single station, click the IP corresponding to the Run->remote start list


Under Linux, run the command in the Bin directory: ./jmeter-n-T sql.jmx-r a server ip1,b server IP, c server IP- l RESULT.JTL

which

-N indicates Nogui mode execution

- T represents the file for the test plan , which is the following sql.jmx (custom file name)

-R indicates the IP of the machine to be remote (no port number required)

-L indicates the path to the result save (custom, note that this file JMeter is not created automatically and needs to be created manually before running)


8. View Results

Under Windows, you can view it directly under a variety of listeners

Under Linux, put RESULT.JTL put under Windows, open with JMeter, with a variety of listeners to see (add any listener in any Testplan, click on the right side of the page brower, open result.jtl file, JMeter will automatically analyze and give results)

Problem:

JMeter 2.13 gives the RESULT.JTL the first line is empty, the name of the item is missing, you can add the following line to the first line of text to open:

Timestamp,elapsed,label,responsecode,responsemessage,threadname,datatype,success,bytes,grpthreads,allthreads, Latency

You can also directly delete the first line of the blank line can be analyzed, it will go through the default configuration items, verified to be correct;

In addition, the analysis of the results, each analysis of a file, you have to clear the results, otherwise the same label will be superimposed together, the result is the wrong result of the overlay, or you can set the label as the request name is different, it will not overlay


Third, the description:

1.jmeter does not load balance during execution, but each machine executes the entire test plan in its entirety, so if you set a concurrency of 500 in jmx, then all machines are 500:3, 1500

2. If you use local file parameterization, you need to upload the file to 3 machines, and the same path

3. My own machine 4g memory, run 500 no problem, remote one to run 2 concurrent 1000 also no problem

4. Remote will be more resource-intensive than a single, so remote multiple stations if the controller server performance is not good, may cause memory overflow or network congestion and other issues

5.linux pressure measurement, it is best not to add any listener, because too much performance, only save JTL results file, and then use the Listener for analysis


This article is from "Ghost" blog, please make sure to keep this source http://fangwei009.blog.51cto.com/5234706/1886976

JMeter Distributed pressure measurement

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.