Saturday, April 30, 2011

How to use jMeter in server mode over an SSH tunnel - Part 2 - Mutliple server instances

This article describes how to run one client JMeter instance with MULTIPLE server instances with inter-JMeter communication tunneled over SSH.

Please read the previous part first (How to use jMeter in server mode over an SSH tunnel).

1) SSH TUNNELS (created from the client machine)
We assume that:
- we have a client machine and a server machine
- client JMeter instance runs on the client machine
- both server JMeter instances run on the server machine.
- we have two server JMeter instances

Create following tunnels:
(tunnels to instance 1)
Local port: 55501 -> 127.0.0.1:55501
Local port: 55511 -> 127.0.0.1:55511
(tunnels to instance 2)
Local port: 55502 -> 127.0.0.1:55502
Local port: 55513 -> 127.0.0.1:55513
(mutual tunnel for callback)
Remote port: 55512 -> 127.0.0.1:55512

2) CLIENT CONFIG
remote_hosts=127.0.0.1:55501,127.0.0.1:55502
client.rmi.callbackport=55512

3) PREPARE JMETER SERVER INSTANCES
Create 2 separate JMeter application folders on the server machine, e.g.
jakarta-jmeter-2.3.4-inst1
jakarta-jmeter-2.3.4-inst2
and put the patched JMeter application into each of them.

They will have different configurations in jmeter.properties. (The same result could be also achieved by having only one application instance and by specifying the different configuration parameters in the start up script on command line.)

Prepare start-up scripts:
(start-jmeter-server-inst1.sh)
#!/bin/sh
./jakarta-jmeter-2.3.4-inst1/bin/jmeter-server -Djava.rmi.server.hostname=127.0.0.1 2>&1 >inst1.log &

(start-jmeter-server-inst2.sh)
#!/bin/sh
./jakarta-jmeter-2.3.4-inst2/bin/jmeter-server -Djava.rmi.server.hostname=127.0.0.1 2>&1 >inst2.log &

3) SERVER CONFIG - INSTANCE 1
(jakarta-jmeter-2.3.4-inst1/bin/jmeter.properties)
server_port=55501
server.rmi.localport=55511
server.rmi.localhostname=127.0.0.1

4) SERVER CONFIG - INSTANCE 2
(jakarta-jmeter-2.3.4-inst2/bin/jmeter.properties)
server_port=55502
server.rmi.localport=55513
server.rmi.localhostname=127.0.0.1

5) GO
Open SSH connection from client to server machine
Start client JMeter
Start server JMeters
Remotely run your test
Check inst1.log and inst2.log for logs from the server instances

6) Done!


TROUBLESHOOTING
1) Ports are already in use on server machine
Make sure no previously started JMeter is running in the background.

2) There are no results coming back to client instance
Make sure you patched also the client instance JMeter application.

20 comments:

  1. Peter, this is perfect - works a dream! You're a legend.

    I might make one comment if I may which is to say that in Section 3 where you say:

    3) PREPARE JMETER SERVER INSTANCES
    Create 2 separate JMeter application folders on the server machine, e.g.
    jakarta-jmeter-2.3.4-inst1
    jakarta-jmeter-2.3.4-inst2
    and put the patched JMeter application into each of them.

    This sounded to me like creating two instances of jmeter on one machine. If anyone else got a bit confused here what I did was to copy up the patched jakarta-jmeter-2.3.4 directory to two different servers (same dir name) and then edit their respective jmeter.properties files as per the article.

    ReplyDelete
  2. Hello,

    since I had only 1 client and 1 server machine I really ran two JMeter server instances on one machine. But there may be also real reasons to do it that way (utilizing hardware paralelism?, limits of single jvm, ..).

    You ran each server instance on a separate server machine? Are you saying that you opened separate SSH connections to both machines and that both connections were tunneling the same port 55512 without problem ? That's good news..

    ReplyDelete
  3. PS. I changed your port 55512 to something else more distinct. Using 55511 for slave number 1 meant I wanted to use 55512 for slave number 2 but would have had to jump to 55513 instead.

    It's arbitrary really, of course any unreserved number works, but it made things more pleasing to the Freudian side of my personality.

    ReplyDelete
  4. Yes, two server instances tunnelling to the same port. In fact, I ran it with three boxes as slaves, each using the same port - it works. Now, if I need, I can fire up as many cloud-based slaves as I desire - very useful, very cheap.

    And yes, I do this to give me access to additional hardware to generate the required load.

    There is one problem where connection warnings are intermittently written to the terminal that launched the tunnels but this does not seem to affect the test, it's just annoying for now, but I need to verify this.

    Overall, this solution is great for those scenarios where I am testing cloud based SUTs and need to generate load from an external source (the Cloud). This is desirable because I do not want traffic streaming out of my local network, which is unrealistic and problematic. So by using this tunnelling solution I can generate the correct load and benefit from rich, real-time feedback to a central location.

    The problem with remote, distributed testing (not tunnelling per se) is that you can end up saturating your incoming bandwidth, even with batch mode set. In this case there are really only two other options (which do not employ your solution):

    1. Run the test remotely in non-gui mode and use the 'generate summary report' listener to get feedback. Like this, there is no tunnel in use and you lose the GUI but you also remove the bandwidth issue and get a solid, reliable test. I think this is the traditional way of using JMeter in such a situation.

    2. Where I really want the extra feedback, I put my MASTER instance in the cloud too and push the GUI back to the client using X11 forwarding. I've only played around with this a bit so far; it works fine for simple tests but I've only tried it from home and it was painfully slow at times and did not seem to scale well. But I have naff broadband which was maxing out at certain points and I didn't really test it fully so I'll reserve judgement.


    Thanks again, great work.

    ReplyDelete
  5. It is one of the foundations for the study of positive psychology, which seeks to focus on strengths and other positive attributes people possess that lead to living a good life, instead of pathologizing them. Thank you. forskolin

    ReplyDelete
  6. Treasurebox is an online store which provide their customers all the latest household items, outdoor furniutre,electronic gadgets nz, Pop up gazebos nz and much more.
    YOu will be easily buy all the items on a single click

    ReplyDelete
  7. I need to communicate my deference of your composing aptitude and capacity to make perusers read from the earliest starting point as far as possible. I might want to peruse more up to date presents and on share my musings with you.

    360DigiTMG

    ReplyDelete
  8. This is a great motivational article. In fact, I am happy with your good work. They publish very supportive data, really. Continue. Continue blogging. Hope you explore your next post
    hrdf claimable courses

    ReplyDelete
  9. You re in motivation behind fact an on-target site administrator. The site stacking speed is amazing. It kind of feels that you're doing a specific trick. What's more, The substance is a masterpiece. you have done a marvelous development concerning this issue!
    360DigiTMG Data Analytics Course

    ReplyDelete
  10. Especially superb!!! Exactly when I search for this I found this webpage at the top of every single online diary in web crawler.
    data science course in malaysia

    ReplyDelete
  11. This is a great motivational article. In fact, I am happy with your good work. They publish very supportive data, really. Continue. Continue blogging. Hope you explore your next post
    HRDF training

    ReplyDelete
  12. This is a great post I saw thanks to sharing. I really want to hope that you will continue to share great posts in the future.
    data scientist course in noida

    ReplyDelete
  13. Probability, statistics, and machine learning come under the scope of Mathematical aspect while applied aspects help you gain knowledge of data science, languages which includes Python, MATLAB, JAVA, SQL. data science course syllabus

    ReplyDelete
  14. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work.

    ReplyDelete
  15. Thanks for sharing such a useful blog. Really! This Blog is very informative for us which contains a lot of information about the Writing. I like this post. trello
    wattpad
    drupal
    slashdot
    seekingalpha

    ReplyDelete
  16. 12Bet – Sportsbook, Casino, Games, App Store
    Read reviews, compare customer ratings, see screenshots, and 퍼스트 카지노 learn more about 12bet 12bet. Rating: 4.3 메리트카지노 · ‎12 reviews

    ReplyDelete
  17. He proposes that the federal government part out digital reel mapping and unbalanced reels. Gamblers would additionally endure fewer issues, he says, if electronic gaming machines displayed how much they stand to lose on every wager. This isn't the only way casinos are making money from you, of course. Good says that lots of the "offers" pushed 토토사이트 by casinos are additionally designed to get customers to spend more in the long run|the lengthy term}. "They typically use special promotions and bonuses to encourage folks to play at their slot machines," he explains.

    ReplyDelete
  18. The Kahnawake Mohawk Territory is a First Nations Reserve inQuebec, Canadathat provides its on-line gambling licensing to international operators. Since 1999 it has grown to become one of many greatest registries within the business with extra than250 massive namesincluding on-line on line casino, poker, live video games, eSports, lotto, sports betting and extra. It is a highly respected jurisdiction with high requirements concerning compliance and moral gambling. Various forms of gambling are legal plenty of} parts of Europe, Central and 바카라 사이트 South America, the Caribbean, Australia, and New Zealand.

    ReplyDelete