日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Jmeter之http性能测试实战 NON-GUI模式 进行分布式压力测试——干货(十二)(转载)...

發(fā)布時間:2025/5/22 编程问答 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Jmeter之http性能测试实战 NON-GUI模式 进行分布式压力测试——干货(十二)(转载)... 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

轉(zhuǎn)載自:https://www.cnblogs.com/Lam7/p/6833501.html

Apache JMeter Distributed Testing Step-by-step

This short tutorial explains how to use multiple systems to perform stress testing. Before we start, there are a couple of things to check.

  • the firewalls on the systems are turned off or correct ports are opened.
  • all the clients are on the same subnet.
  • the server is in the same subnet, if?192.x.x.x?or?10.x.x.x?IP addresses are used. If the server doesn't use?192.xx?or?10.xx?IP address, there shouldn't be any problems.
  • Make sure JMeter can access the server.
  • Make sure you use the same version of JMeter and Java on all the systems. Mixing versions will not work correctly.

Once you've made sure the systems are ready, it's time to setup remote testing. The tutorial assumes you already have JMeter installed on all the systems. The way JMeter works is one master controller initiates the test on multiple slave systems.

?

Before we dive into the step-by-step instructions, it's a good idea to define the terms and make sure the definition is clear.

Master
the system running JMeter GUI, which controls the test
Slave
the system running?jmeter-server, which takes commands from the GUI and send requests to the target system(s)
Target
the webserver we plan to stress test

?

?

  • On the slave systems, go to?jmeter/bin?directory and execute?jmeter-server.bat(jmeter-server?on unix).
  • On master system acting as the console, open windows explorer and go to?jmeter/bin?directory
  • Open?jmeter.properties?in a text editor
  • Edit the line?remote_hosts=127.0.0.1
  • Add the IP address. For example, if I have JMeter server running on?192.168.30.50:1099, …,?192.168.30.51:1099,the entry would like like this:
  • Start JMeter.
  • Open the test plan you want to use
  • ?

    ?Start a single clients

  • Click Run at the top
  • Select Remote Start
  • Select the IP address
  • Start all clients

    ?

  • Click Run at the top
  • Select Remote Start all or use?Ctrl?+?Shift?+?R
  • ?

    Limitations

    There are some basic limitations for distributed testing. Here's the list of the known items in no specific order.

  • RMI cannot communicate across subnets without a proxy; therefore neither can JMeter without a proxy.
  • Since version 2.9, JMeter sends all the test results stripping Response data to the controlling console, this allows us to reduce impact on network IO. Ensure you monitor your network traffic so that this trafic does not incur contention
  • A single JMeter client running on a 2-3 GHz CPU (recent CPU) can handle 1000-2000 threads depending on the type of test.
  • 簡單點的說

    Jmeter分布式執(zhí)行原理:

      1、Jmeter分布式測試時,選擇其中一臺作為調(diào)度機(master),其它機器做為執(zhí)行機(slave)。

      2、執(zhí)行時,master會把腳本發(fā)送到每臺slave上,slave 拿到腳本后就開始執(zhí)行,slave執(zhí)行時不需要啟動GUI,我理解它應(yīng)該是通過命令行模式執(zhí)行的。

      3、執(zhí)行完成后,slave會把結(jié)果回傳給master,master會收集所有slave的信息并匯總。

    術(shù)語解析

    • master,以GUI模式運行,同時控制測試的運行,在這里就是client,啟動腳本所在的那臺機器。
    • slave,運行jmeter-server并從master接收指令、向目標(biāo)服務(wù)器發(fā)送請求
    • 設(shè)置jmeter-server:

      用文本編輯器打開Jmeter/bin目錄下的jmeter.properties文件,添加運行jmeter-server的主機IP到remote_hosts

      remote_hosts=192.168.30.50:1099,192.168.30.51:1099,localhost.....

    ?如果你不希望你的客戶端也作為jmeter-server運行的話,把localhost從上面的配置中移除。

    ?

    小白解釋分割線

    ?----------------------------------------------------------

    再白癡點的解釋就是 ? 有 A B C ?三臺壓力機器,屬于同一個內(nèi)網(wǎng)IP

    A作為 Master

    B跟C兩臺作為slave

    通過A去控制B跟C進行壓測服務(wù)器
    在壓測的過程中 需要先開啟B跟C的Jmeter的bin目錄下的jmeter-server.bat 服務(wù)

    然后通過A去進行NON-GUI模式去壓測,B跟C分布式的壓測結(jié)果會反饋到A

    -----------------------------------------------------------

    小白解釋結(jié)束線

    ?

    下面進行實戰(zhàn)命令 壓測

    通過 jmeter -l 的幫助命令可以查看到

    C:\Users\lamw\Desktop\lamw λ D:\Jmeter\jmeter-3.1\bin\jmeter -l Error: Missing argument to option -l Usage--?print command line options and exit-h, --helpprint usage information and exit-v, --versionprint the version information and exit-p, --propfile <argument>the jmeter property file to use-q, --addprop <argument> additional JMeter property file(s) -t, --testfile <argument> the jmeter test(.jmx) file to run -l, --logfile <argument> the file to log samples to -j, --jmeterlogfile <argument> jmeter run log file (jmeter.log) -n, --nongui run JMeter in nongui mode -s, --server run the JMeter server -H, --proxyHost <argument> Set a proxy server for JMeter to use -P, --proxyPort <argument> Set proxy server port for JMeter to use -N, --nonProxyHosts <argument> Set nonproxy host list (e.g. *.apache.org|localhost) -u, --username <argument> Set username for proxy server that JMeter is to use -a, --password <argument> Set password for proxy server that JMeter is to use -J, --jmeterproperty <argument>=<value> Define additional JMeter properties -G, --globalproperty <argument>=<value> Define Global properties (sent to servers) e.g. -Gport=123 or -Gglobal.properties -D, --systemproperty <argument>=<value> Define additional system properties -S, --systemPropertyFile <argument> additional system property file(s) -L, --loglevel <argument>=<value> [category=]level e.g. jorphan=INFO or jmeter.util=DEBUG -r, --runremote Start remote servers (as defined in remote_hosts) -R, --remotestart <argument> Start these remote servers (overrides remote_hosts) -d, --homedir <argument> the jmeter home directory to use -X, --remoteexit Exit the remote servers at end of test (non-GUI) -g, --reportonly <argument> generate report dashboard only, from a test results file -e, --reportatendofloadtests generate report dashboard after load test -o, --reportoutputfolder <argument> output folder for report dashboard Error: Missing argument to option -l

    其中

    -r, --runremote ? ?

    Start remote servers (as defined in remote_hosts)------------------啟動遠程服務(wù)器(如remote_hosts中定義)
    -R, --remotestart <argument>
    Start these remote servers (overrides remote_hosts)-------------------啟動這些遠程服務(wù)器(覆蓋remote_hosts)

    那么我們就可以去選擇執(zhí)行所有的配置中的壓測機器

    D:\Jmeter\jmeter-3.1\bin\jmeter.bat -n -r -t test.jmx -l test.csv -e -o?test

    ?

    可以看到已經(jīng)成功執(zhí)行了配置中的2臺壓測機

    ?

    PS 如果壓測指標(biāo)是1000并發(fā)數(shù),比如我們現(xiàn)在配置了2臺需要達到1000并發(fā)數(shù),那么就是一臺壓測并發(fā)數(shù)500即可

    ?

    轉(zhuǎn)載于:https://www.cnblogs.com/yuany66/p/10978139.html

    《新程序員》:云原生和全面數(shù)字化實踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀

    總結(jié)

    以上是生活随笔為你收集整理的Jmeter之http性能测试实战 NON-GUI模式 进行分布式压力测试——干货(十二)(转载)...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。