Using JMeter Plugins in Load Tester (multiple remote servers) Powered by Apache JMeter™

How to use JMeter Plugins in Load Tester (multiple remote servers) Powered by Apache JMeter™.

Load Tester (multiple remote servers) Powered by Apache JMeter™ is an Apache JMeter™ running on multiple servers on Microsoft Azure that can be used for large-scale load testing.

JMeter Plugins can be used to extend the types of sampler and listeners that are not provided by the default JMeter.

Some JMeter Plugins require that the library files required to use the plugin be distributed to all JMeter servers.
However, when you have a large number of JMeter servers, setting up plug-ins for all of them can be a tedious task.

The Load Tester (multiple remote servers) Powered by Apache JMeter™ provides an easy way to achieve this.
* Some plugins may not be supported.

Outline of steps

  1. Get JMeter Plugins Manager
  2. Install JMeter Plugins Manager in the JMeter client
  3. Checking library files already installed
  4. Install plugins to the JMeter client
  5. Checking library files added by installing plugins
  6. Create a directory for plugins for the JMeter servers on the network disk and copy the plugin library files to there.
  7. Set the search_paths and plugin_dependency_paths in the jmeter.properties file for the JMeter servers
  8. Restart all JMeter servers

Details of steps

In this article, I will explain how to use the SSH Sampler by setting up the “SSH Protocol Support” plugin installed from the JMeter Plugins Manager.

  1. Get JMeter Plugins Manager
    Login to the JMeter client by a Remote Desktop and download the latest version of the Plugins Manager from the following page using a web browser.
    https://jmeter-plugins.org/install/Install/
    Alternatively, you can also download it by running the following command in the console.

    $ wget -O jmeter-plugins-manager.jar https://jmeter-plugins.org/get/
    
  2. Install JMeter Plugins Manager in the JMeter client
    Copy the jar file of JMeter Plugins Manager you just downloaded to /usr/local/jmeter/lib/ext .

    $ cp jmeter-plugins-manager.jar /usr/local/jmeter/lib/ext
    
  3. Checking library files already installed
    In order for the Plugin Manager to be able to determine which files are installed in future processes, record the current list of library files.

    $ ls -d $(find /usr/local/jmeter/lib -type f) > jmeter-libs-before.txt
    
  4. Install plugins to the JMeter client

    1. Launch the JMeter
    2. Select “JMeter Plugins Manager” from Menu > Options > Plugins Manager.
    3. Select “SSH Protocol Support” in the Available Plugins tab.
      Plugins Manager - SSH Protocol Support
      You will see “install library: jsch”, “install plugin: ssh-sampler 1.1.1-SNAPSHOT”, etc. in the Review Changes field.
    4. Click [Apply Changes and Restart JMeter]
      JMeter will be restarted.
  5. Checking library files added by installing plugins
    Execute the following command to find the added library files.

    $ ls -d $(find /usr/local/jmeter/lib -type f) > jmeter-libs-after.txt
    $ diff jmeter-libs-before.txt jmeter-libs-after.txt
    46a47
    > /usr/local/jmeter/lib/ext/ApacheJMeter_ssh-1.1.1-SNAPSHOT.jar
    81a83
    > /usr/local/jmeter/lib/jsch-0.1.50.jar
    

    In this example, you can see that “lib/ext/ApacheJMeter_ssh-1.1.1-SNAPSHOT.jar” and “lib/jsch-0.1.50.jar” have been added.

    You may also see “lib/json-lib-2.4-jdk15.jar” and others.
    This file is added by setting up the JMeter Plugins Manager and it is not required for SSH Protocol Support.

  6. Create a directory for plugins for the JMeter servers on the network disk and copy the plugin library files to there
    Network disks are mounted in /mnt/systmp and /mnt/jmuserdata on the JMeter client and JMeter servers.
    On either of these, create a directory to place the plugin’s library files and copy the added files to it.

    mkdir -p /mnt/systmp/lib/ext
    cp /usr/local/jmeter/lib/ext/ApacheJMeter_ssh-1.1.1-SNAPSHOT.jar /mnt/systmp/lib/ext
    cp /usr/local/jmeter/lib/jsch-0.1.50.jar /mnt/systmp/lib
    
  7. Set the search_paths and plugin_dependency_paths in the jmeter.properties file for the JMeter servers
    The jmeter.properties file for the JMeter servers can be reflected by editing the /mnt/systmp/jmeter.properties file from the JMeter client.
    Find the “search_paths” and “plugin_dependency_paths” in this file and set up the directory where you placed the jar file in the previous step as follows.

    # List of directories (separated by ;) to search for additional JMeter plugin classes,
    # for example new GUI elements and samplers.
    # Any jar file in such a directory will be automatically included,
    # jar files in sub directories are ignored.
    # The given value is in addition to any jars found in the lib/ext directory.
    # Do not use this for utility or plugin dependency jars.
    search_paths=/mnt/systmp/lib/ext
    
    # ...
    
    # List of directories (separated by ;) that JMeter will search for utility
    # and plugin dependency classes.
    # Any jar file in such a directory will be automatically included,
    # jar files in sub directories are ignored.
    # The given value is in addition to any jars found in the lib directory
    # or given by the user.classpath property.
    # All entries will be added to the path of the JMeter internal loader only.
    # For plugin dependencies this property should be used instead of user.classpath.
    plugin_dependency_paths=/mnt/systmp/lib
    
  8. Restart all JMeter servers
    Restart the virtual machine scale set of JMeter servers in Azure Portal.
    The scale set of the virtual machine of JMeter servers has been created with the name specified as the Virtual machine scale set name for the JMeter Servers when the Load Tester was introduced.
    Reboot JMeter Servers
    This allows all JMeter servers to be restarted centrally and the SSH Protocol Support plugin to be available.

Operation check

Let’s test it in JMeter against the SSH server.

  1. Launch the JMeter

  2. Add a “Thread Group” to the Test Plan
    Add > Threads (Users) > Thread Group

  3. Add a “SSH Command” sampler to the Thread Group and configure it Add > Sampler > SSH Command
    SSH Command

    • Server
      • Hostname: Destination hostname.
    • Login
      • User Name: Login user name.
      • Password or Client certificate: Password or client certificate information for the user connecting.
    • Execute
      • Command: Commands to be tested.
  4. Add an appropriate listener to a Test Plan or the same Thread Group
    Add a “View Results Tree” and check how it works.
    Add > Listener > View Results Tree

  5. Run the Test
    MENU > Run > Remote Start All

  6. Check the results
    Select the Sampler result of the appropriate SSH command in the View Results Tree and if the response message is “OK”, the request by the test is successful.
    View Results Tree

If your request is not successful, the following procedure may help you determine the cause.

  • Browse the Log Viewer

    1. MENU > Options > Log Viewer
    2. Determine the cause of the failure from the information output in the log viewer displayed in the lower right corner of the window, such as Exceptions.
  • Run tests with just the JMeter client

    1. MENU > Run > Start
    2. Investigate the cause of the problem from the “Response data” of a SSH Command that is an error in the View Results Tree.
  • Change it to allow remote testing to get response data as well, If the client-only test doesn’t produce an error

    1. Set mode to Standard in the jmeter.properties file (/usr/local/jmeter/bin/jmeter.properties) on the client.
      # Remote batching support
      # Since JMeter 2.9, default is MODE_STRIPPED_BATCH, which returns samples in
      # batch mode (every 100 samples or every minute by default)
      # Note also that MODE_STRIPPED_BATCH strips response data from SampleResult, so if you need it change to
      # another mode
      # Batch returns samples in batches
      # Statistical returns sample summary statistics
      # mode can also be the class name of an implementation of org.apache.jmeter.samplers.SampleSender
      mode=Standard
      
    2. Start or restart JMeter on the client
    3. Run the test with “Remote Start All” and investigate the cause of the problem from the “Response data” of a SSH Command that is an error in the View Results Tree.

    Be sure to restore the mode setting in the jmeter.properties file once you’ve solved the problem.