要求:
- 1、相同的jmeter版本
- 2、最好相同的java版本
jmeter可以通過master-slave的方式實現更大的並發,但是作為master的機器將會消耗更多的資源,因為所有的slave的壓測數據都要通過網絡傳輸到master機器上,然后由master機器完成這些數據的整理和輸出。
各個slave並非分布式,而是都跑相同的測試用例。Note: The same test plan is run by all the servers. JMeter does not distribute the load between servers, each runs the full test plan. So if you set 1000 Threads and have 6 JMeter server, you end up injecting 6000 Threads.
壓測時,master會把jmx腳本內容發給所有的slave,由slave執行壓測任務。但是數據文件不會被master發給slave,因此過程中如果需要從csv中獲取數據,需要提前放到slave機器里去,或者slave機器可以連接讀取的文件服務器等。If the test uses any data files, note that these are not sent across by the client so make sure that these are available in the appropriate directory on each server
控制slave/server的采樣結果返回方式:異步方式、同步方式。默認情況下,是同步方式,一旦有采樣結果,立即返回給master/client,這會影響slave/server的最大吞吐量。
對於多個slave/server的情況,如果出現連接失敗的slave/server,master/client如何處理?設置user.properties或者jmeter.properties
- client.tries 嘗試連接的次數
- client.retries_delay 嘗試連接的時間間隔
- client.continue_on_fail=true 連接失敗后是否繼續執行
Apache JMeter Distributed Testing Step-by-step:
http://jmeter.apache.org/usermanual/jmeter_distributed_testing_step_by_step.html
./jmeter - 打印命令行選項
-X, --remoteexit
Exit the remote servers at end of test (non-GUI)
測試結束后退出遠端的服務器
原文:http://jmeter.apache.org/usermanual/remote-test.html
參考翻譯:https://www.jianshu.com/p/1a4dc49b1993