"Turn" JMeter distributed stress test

Source: Internet
Author: User

installation

:http://jmeter.apache.org/download_jmeter.cgi

Installation Prerequisites (because JMeter relies on Java, you must first configure Java).

Unzip after download:

Tar-xvzf apache-jmeter-3.1.tgz

jmeter Parameters

[HTML]View PlainCopy 
  1. -H,--help
  2. Print usage information and exit
  3. #打印帮助信息
  4. -V,--version
  5. Print the version information and exit
  6. #打印版本信息
  7. -P,--propfile {argument}
  8. The JMeter property file to use
  9. #运行时指定property文件, the default is to use the jmeter.properties in the Jmeter_home/bin directory, if the user has other configurations, add
  10. #用法如下:-P user.properties
  11. -Q,--addprop {argument}
  12. Additional property file (s)
  13. #其它配置文件, such as JVM parameters, etc.
  14. -T,--testfile {argument}
  15. The JMeter test (. jmx) file to run
  16. #要运行的jmeter脚本
  17. -j,--jmeterlogfile {argument}
  18. The JMeter log file
  19. #指定记录jmeter log file, default to Jmeter.log
  20. -L,--logfile {argument}
  21. The file to log samples to
  22. #记录采样器Log的文件
  23. -N,--nongui
  24. Run JMeter in Nongui mode
  25. #以nongui模式运行jmeter
  26. -S,--server
  27. Run the JMeter server
  28. #运行JMeter Server
  29. -H,--proxyhost {argument}
  30. Set a proxy server for JMeter
  31. #代理服务器地址
  32. -P,--proxyport {argument}
  33. Set Proxy Server port for JMeter
  34. #代理服务器端口
  35. -U,--username {argument}
  36. Set username for proxy Server JMeter
  37. #代理服务器的用户名
  38. -A,--password {argument}
  39. Set password for proxy server JMeter
  40. #代理服务器用户名对应的密码
  41. -j,--jmeterproperty {argument}={value}
  42. Define Additional JMeter Properties
  43. #定义额外的Jmeter属性
  44. -G,--globalproperty (argument) [= (value)]
  45. Define Global Properties (sent to servers)
  46. e.g. -gport=123
  47. Or-gglobal.properties
  48. #定义发送给server的全局属性
  49. #如:-gport=123 or-gglobal.properties (specifies the port of the listener server)
  50. -D,--systemproperty {argument}={value}
  51. Define Additional System Properties
  52. #定义系统属性
  53. -S,--systempropertyfile {filename}
  54. A property file to be added as System properties
  55. #通过指定的property文件定义系统属性
  56. -L,--loglevel {argument}={value}
  57. Define loglevel: [category=]level
  58. e.g. jorphan=INFO or jmeter.util=DEBUG
  59. #定义日志等级
  60. -R,--runremote (Non-gui only)
  61. Start remote servers (as defined by the JMeter property remote_hosts)
  62. #启动远程server (remote_hosts defined in JMeter property), this parameter is not valid in Non-gui mode
  63. -R,--remotestart Server1,... (Non-gui only)
  64. Start these remote servers (Overrides remote_hosts)
  65. #启动远程server (If you use this parameter, the remote_hosts defined in the JMeter property will be ignored)
  66. -D,--homedir {argument}
  67. The JMeter home directory to use
  68. #Jmeter运行的主目录
  69. -X,--remoteexit
  70. Exit the remote servers at end of test (Non-gui)
  71. #测试结束时, exit (in Non-gui mode)



Configuring JMeter Client & Server

After understanding the above parameters, start configuring the distributed test

Let's take a look at what the official documents say, and add comments to me in Chinese:

1. The firewalls on the systems is turned off. #1. Turn off the firewall

2. All the clients is on the same subnet. #2. All clients are within the same subnet

3. The server is in the same subnet, if 192.x.x.x or 10.x.x.x IP addresses is used. If the server

Doesn ' t use 192 or IP address, there shouldn ' is any problems. #3. Server must also be in the same subnet if 192.x.x.x or 10.x.x.x such IP addresses are used, if serv Er does not use an IP address of 192 or 10, (server is not in the same subnet as client) there will be no problem

4. Make sure JMeter can access the server. #4. Ensure that JMeter has access to the server

5. Make sure to the same version of JMeter on all the systems. Mixing versions

correctly. #5. Ensure that the JMeter versions of the systems are consistent and that different versions of JMeter will not work well

explanation of some terms:

· Master, run in GUI mode while controlling the run of the test, here is the client, the machine where the script is started.

· Slave, running Jmeter-server and receiving instructions from master, sending requests to the target server

Set Jmeter-server:

Open the Jmeter.properties file in the Jmeter_home/bin directory with a text editor and add the host IP that runs jmeter-server to Remote-hosts

remote_hosts=10.0.0.158, 10.0.0.140,localhost

If you do not want your client to run as Jmeter-server, remove localhost from the configuration above.

Note here: It is recommended to use the actual IP instead of localhost, otherwise it is easy to error.

Actual Combat stage:

First, the client starts JMeter in GUI mode and then opens or creates a test script

Second, start all remote server from GUI mode, method: Run-remote all start, see, can also start a single jmeter-server

Third, the use of No-gui method for pressure testing

Jmeter-t "JMS point-to-point.jmx"-n-l testresult.csv-r

-T: from which JMX boot

-N: Stress test in a no-gui manner

-L: Log log

-r: Start remote server (remote_hosts defined in JMeter property), this parameter is not valid in Non-gui mode

So far, the JMeter distributed test has been run through Non-gui mode.

Here's a tip: running JMeter in a distributed way is to run the same test script on all servers, that is, if you're going to 1s up to 100 threads, if you're using 5 machines for distributed testing, debug the script to 20 threads from 1s, otherwise, the 1s has 500 threads, which may differ from your expectations.

"Turn" JMeter distributed stress test

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.