====== Client/Server Jmeter ====== The trick to use client/server mode with jmeter is that the client and the server need to be able to establish connections to each other.{{:en:ressources:astuces:logo.jpg |}} From the doc: "//JMeter/RMI requires a connection from the client to the server. This will use the port you chose, default 1099. JMeter/RMI also requires a reverse connection in order to return sample results from the server to the client. This will use a high-numbered port. If there are any firewalls or other network filters between JMeter client and server, you will need to make sure that they are set up to allow the connections through. If necessary, use monitoring software to show what traffic is being generated.//" If the client is behind a NAT, you have to DNAT to make the connections coming from the server are routed to the client. Have fun. ===== EC2 Jmeter startup checklist ===== ==== On the server node ==== 1. Start the EC2 instance “jmeter node” 2. Attach the elastic IP 1.2.3.4 to the instance 3. Increase the max number of files descriptors # ulimit -n 65535 # ulimit -S -n 65535 4. Add the public DNS name to the internal IP in /etc/hosts 10.202.125.54 jmeternode1.example.net jmeternode1 5. Change the hostname “hostname jmeternode1” 6. If running, shut down nscd **/etc/init.d/nscd stop** and make sure the ping on the public dns returns the local IP (nscd caches dns resolution and we don’t want that) 7. Modify /opt/jakarta-jmeter-2.3.2/bin/jmeter-server to add the public DNS in RMI_HOST_DEF=-Djava.rmi.server.hostname=jmeternode1.example.net 8. Make sure this variable is in the startup command line, right below ${DIRNAME}/jmeter ${RMI_HOST_DEF} -Dserver_port=${SERVER_PORT:-1099} -s -j jmeter-server.log "$@" 9. Start a “screen” and launch the node /opt/jakarta-jmeter-2.3.2/bin/jmeter-server (detach the screen with ctrl+a / ctrl+d) 10. Check the logs to make sure the node binds on the local IP but exposes the public DNS 2011/04/01 12:48:08 INFO - jmeter.JMeter: IP: 10.202.125.54 Name: jmeternode1.example.net FullName: jmeternode1.example.net ==== On the client ==== 1. Check the memory in ‘jakarta-jmeter-2.3.2/bin/jmeter’ 2. Check the remote hosts in ‘jakarta-jmeter-2.3.2/bin/jmeter.properties’ remote_hosts=jmeternode1.example.net:1099,jmeternode2.example.net:1109 3. Change the local hostname in /etc/hosts so it returns the public ip # hostname Julienlaptop # vim /etc/hosts 80.127.50.46 julienlaptop.linuxwall.info julienlaptop 4. Update the NAT rules to NAT everything coming from the server nodes to the client. === launch the client without a X server === (useful if your client is in EC2 as well) Launch the jmeter client with the following command $ ./jmeter -n -t viewer.jmx -p jmeter.properties -l jmeter.log –r It will launch the test “viewer.jmx” on all the remote nodes (-r) listed in the properties file (-p) ==== Note on the firewall rules ==== Make sure that, between the client and the server nodes, TCP communications are unfiltered for any pair of ports. RMI will create multiple connections between the client and the nodes, and those connections will use random TCP ports (source and destination).