"Go" jmeter remote test

Source: Internet
Author: User

detailed JMeter remote testing (1)If the performance of the machine running the JMeter client does not meet the requirements of the test, the tester can control multiple remote JMeter servers through a single JMeter GUI client in order to stress test the server and simulate a sufficient number of concurrent users. By running JMeter remotely, testers can replicate tests across multiple low-end computers, which can simulate a larger server pressure. A JMeter GUI client instance that theoretically controls as many remote JMeter instances as possible and collects test data from them, as shown in 11-3.  In this way, you have the following characteristics: Save the test sample data to the local machine.  Manage multiple JMeter execution engines with a single machine.  There is no need to replicate the test plan to each machine, and the JMeter GUI client will send it to each JMeter server. Each JMeter remote server performs the same test plan.  JMeter does not load balance between the executive machines, and each server runs the test plan in its entirety. Thread 100~300 can be handled on 1.4ghz~3ghz CPUs, jmeter clients with 1GB of memory. But Web service exceptions. XML processing is CPU intensive and consumes all of the CPU quickly. Generally speaking, the application system with XML technology as the core, its performance will be the 10%~25% of ordinary Web application.  In addition, if all the load is generated by one machine, both the NIC and switch ports can create bottlenecks, so the number of one JMeter client threads should not exceed 100. Using JMeter remote mode is not more resource-intensive than running the same number of non-GUI tests independently.  However, if a large number of JMeter remote servers are used, the client may be overloaded, or the network connection will be congested. Note that if the tester installs the JMeter execution engine on the application server (the test target), it will obviously add to the burden on the application server and the test results will become untrustworthy. The author recommends that the JMeter remote server be placed in the same network segment where the application server (the test target) resides.  This reduces the impact of the JMeter collection of test results on the network and avoids the impact on the application server (test target) performance. Here are the basic steps to start JMeter remote testing: Step 1: Configure the nodeEnsure that all nodes (JMeter clients and JMeter remote servers) run the same version of JMeter.  Use the same Java version on all operating systems whenever possible. If the test uses external data files, be aware that these files are not distributed by the JMeter client, so testers need to make sure that the data files are saved on each execution machine (and that the directory must be the correct one). If necessary, the user can set different attribute variables for each executor, that is, edit the user.properties or system.properties file on the JMeter remote server. These properties will be recognized when the JMeter remote server is started and may be applied to the test plan, affecting test execution (for example, interacting with other remote servers). In addition, different jmeter remote servers may use different content data files (for example, each server must use a different ID to partition the data files). Step 2: Start the remote serverTo start the JMeter remote node, run Jmeter_home/bin/jmeter-server (UNIX) or Jmeter_home/bin/jmeter-server.bat (Windows) script on the execution machine. Note that only one JMeter remote server script can be run on each remote node, unless a different RMI port is used. Starting with the JMeter 2.3.1, the JMeter remote server initiates the RMI registration itself, and there is no need for the user to initiate RMI registration separately.  Assuming the tester must initiate RMI registration separately, the JMeter attribute Server.rmi.create=false can be defined on the remote node. By default, the RMI for the JMeter remote server uses the dynamic port number. This will cause trouble with the firewall configuration, so JMeter 2.3.2 and later versions will check the JMeter property Server.rmi.localport. If the value is nonzero, the JMeter remote server uses it as the local port number. Step 3: Add the IP address of the JMeter remote server to the client properties fileEdit the properties file of the JMeter control machine. Locate the attribute "Remote_hosts" in the/bin/jmeter.properties file, using the IP address of the JMeter remote server as its property value.  You can add IP addresses for multiple servers, separated by commas. Note that testers can also use the-r command-line option to indicate the remote server that will be used. This is the same effect as using the-R and-jremote_hosts={server list}.  such as Jmeter-rhost1,127.0.0.1,host2. If the tester defines the JMeter property server.exitaftertest=true, the remote server exits after running a single test. The-Z flag also has the same effect, see the following. Step 4 (a): Start the JMeter test via GUI clientNow it's the turn to start the JMeter GUI client. Run the "Bin/jmeter.bat" script in the Ms-windows environment and run the "Bin/jmeter" script in a UNIX environment. TestThe person will find that under the Run menu, there are two submenu "Remote Start" and "Remote Stop", as shown in 11-4. These two submenus contain the JMeter remote server IP address set by the tester in the properties file.  At this point, use remote start and stop instead of normal jmeter to start and stop. Figure 11-4 Run Menu Step 4 (b): Start the JMeter test with a non-GUI clientThere is another way that testers can start a remote server through a non-GUI client.  The command is as follows: Jmeter-n-T script.jmx-r or: jmeter-n-t script.jmx-r server1,server2 ...  Other flags may also be useful.  -gproperty=value: Defines a property (which can appear multiple times) in all jmeter remote servers-Z: Exits the remote server after the test is finished. The first example launches the remote server defined in the JMeter property remote_hosts, and the second example defines the list of remote servers and then starts them. The command-line client exits after all servers are stopped. 1. Manually configuring JMeter Remote testingIn some cases, the Jmeter-server script does not work properly work(If the tester uses Operating SystemNot within the scope of JMeter developers ' expectations). Here's how to start the JMeter remote server (corresponding to step 2 above), which contains more manual actions. Step 2 (a): Start RMI RegistrationStarting with JMeter 2.3.1, the JMeter remote server will start the RMI registration itself, so the content here is not applicable to the general situation. If you want to take a historical version of the action method, first define the JMeter property on the JMeter remote server Server. Rmi.create=false, and follow the guidelines below. JMeter uses remote Method invocation (RMI) as a mechanism for long-distance communication. Therefore, testers need to use the RMI registration program (named "Rrmiregistry") in the JDK "bin" directory.  Before running Rmiregistry, make sure that the following jar exists in the tester's system Claspath: Jmeter_home/lib/ext/apachejmeter_core.jar.  Jmeter_home/lib/jorphan.jar.  Jmeter_home/lib/logkit-1.2.jar. Registering a program requires access to a specific JMeter class. No parameters are required to run rmiregistry. By default, the application listens on port 1099. Step 2 (b): Start the JMeter remote serverOnce the RMI registration program is running, the JMeter remote server is started.  JMeter startup scripts are required to carry the "-S" option. Step 3 and Step 4 are described above. 2. Some little tricks .Jmeter/rmi requires the establishment of a connection from the client to the remote server. This will use the port number chosen by the tester, and the default value is 1099. Jmeter/rmi also requires a reverse connection to return the test sample results from the remote server to the client. This will use a higher number of port numbers. If there are any firewalls or network filters between the JMeter client and the JMeter remote server, testers need to make sure that they are properly configured and allow related connections to communicate.  If necessary, use the listening software to observe the communication process. If JMeter runs on SuSE Linux, the following tips may be helpful to testers. The default installation may start the firewall. In this scenario, the remote test will not work correctly. If the tester discovers that the connection has been rejected, you can open debugging with the following options. Starting with the JMeter 2.3.1 version, RMI Registration is initiated by the JMeter remote server, although the relevant options can still be passed through the JMeter command line. For example, "Jmeter-s-dsun.rmi.loader.loglevel=verbose" (omitting the-j prefix).  In addition, these properties can be defined in the System.properties file. The workaround is to remove the loopback (Loopback) from Etc/hosts for 127.0.0.1 and 127.0.0.2.  When the loopback of 127.0.0.2 is invalid, jmeter-server will not be able to connect to rmiregistry. Replacement: ' DirName $ '/jmeter-s "[email protected]" is: host= "-djava.rmi.server.hostname=[computer_name][computer_domain]-D Java.security.policy= ' dirname $ '/[policy_file] "' DirName $ '/jmeter $HOST-S" [email protected] "Create a rule (qolicy) file at the same time, Add [Computer_name][computer_domain] lines to/etc/hosts. 3. How to use different port numbersBy default, JMeter uses the standard RMI port number 1099 (which can be changed).  To successfully change the port number used, the following conditions must be met: On the remote server, start rmiregistry using the new port number.  On the remote server, start JMeter and pre-Define the Server_port property.  On the client side, update the Remote_hosts property, which contains the remote Host:port settings. Starting with version JMeter 2.1.1, the Jmeter-server script supports changing the port number. For example, suppose TestThe person wants to use the port number 1664 (possibly because the 1099 port is already occupied by another application). Windows System (DOS window): c:\jmeter> SET server_port=1664 c:\jmeter> jmeter-server [Other options] Unix Systems:$ server_port=1664 Jmeter-server [other options] [N.B. Use upper cases for the environment variable] in either case, the script will start on the specified port  Rmiregistry, and then starts JMeter in remote server mode, and the "Server_port" attribute is already defined. The selected port number will be logged to the remote server's Jmeter.log file (Rmiregistry will not create a log file). 4. Using Sample BatchesThe listeners in the test plan return their results to the JMeter client, and the JMeter client writes these results to the specified file by default, and the sample results are sent back to the JMeter client as soon as it is generated. This can create a lot of pressure on the network and JMeter clients.  Users can change the default action by setting some properties.  Pattern (mode) (sample result send mode) is standard by default.  Standard: Sent immediately after the sample results have been generated. Hold: Saves the sampled results in an array until the test is finished.  This may consume a large amount of memory on the remote server.  Batch: Sends the saved sample results when the counter or time exceeds the threshold value. Statistical: When the counter or time exceeds the threshold, the sampled results are sent as a summary, and the sampling results are summarized in the thread group name and sample label.  The accumulated data fields include: elapsed time, latency, Bytes, sample count, error count, and other data fields will be discarded.  Stripped: The response data for the successful sample is removed.  Strippedbatch: The response data for the successful sample is removed and sent in batches. Custom implementation: Sets the mode parameter to the class name of the tester's custom sample sender.  The class must implement Interface Samplesender, and the class's constructor has only one parameter of type Remotesamplelistener.  The following properties affect batch and statistical modes.  Num_sample_threshold: Number of samples in a batch (default is 100). Time_threshold: The number of milliseconds to wait (default is 60 seconds).

"Go" jmeter remote test

Related Article

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.