如何在Jmeter中配置在从机上运行的线程数? [英] How to configure the number of threads to run on slave machines in Jmeter?
问题描述
如何控制每个jmeter从机上运行的线程数.
即,如果我总共有 300 个线程和 2 个从机,我希望负载在两台从机上平均分配 - 150 个线程在从属机器 A 上运行 &150 个线程在从属机器 B 上运行.
我也尝试使用以下命令在非 gui 模式下运行
Jmeter -n -t TESTING.jmx -R 10.27.30.93 –J 6
让它在一个特定的从服务器上运行 6 个线程,但它不工作.
它调用与测试计划中保存的相同数量的线程
使用
修改您的 JMeter 启动脚本调用如下:
jmeter -n -t TESTING.jmx -R 10.27.30.93 –Gthreads=6
根据 JMeter 命令行帮助:
-G, --globalproperty <参数>=<值>定义全局属性(发送到服务器)例如-Gport=123或 -Gglobal.properties
另一个选项是在 user.properties 文件(位于 JMeter 安装的/bin 文件夹下)中为每个远程引擎配置所需的线程数.
有关设置和/的更多信息,请参阅 Apache JMeter 属性自定义指南或覆盖 JMeter 属性.
How can I control the number of threads running on each jmeter slave machines.
i.e. if I have 300 threads in total and 2 slave machines, I want the load to be distributed evenly on both slave machine - 150 threads to run on slave machine A & 150 Threads to run on slave machine B.I have tried running in non gui mode also with the below commands
Jmeter -n -t TESTING.jmx -R 10.27.30.93 –J 6
to make it run on a specific slave server for 6 threads, but its not working.
It invokes the same number of threads saved in the test plan解决方案Set "Number of Threads" for Thread Group(s) using __P() function like
${__P(threads,)}
Amend your JMeter startup script invocation as follows:
jmeter -n -t TESTING.jmx -R 10.27.30.93 –Gthreads=6
As per JMeter command-line help:
-G, --globalproperty <argument>=<value> Define Global properties (sent to servers) e.g. -Gport=123 or -Gglobal.properties
Another option is configure desired number of threads for each remote engine in user.properties file (lives under /bin folder of JMeter installation).
See Apache JMeter Properties Customization Guide for more information on setting and/or overriding JMeter Properties.
这篇关于如何在Jmeter中配置在从机上运行的线程数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!