使用JMeter从站时如何计算吞吐量?

时间:2017-09-05 02:44:04

标签: jmeter remote-execution

鉴于我有一个JMeter测试脚本,每分钟有200个事务(运行线程)的常量吞吐量, 我有两个由JMeter master控制的Slave将执行该脚本,生成的吞吐量是否会加倍,或者JMeter是否共享从站之间的负载,导致仍然是200TPM?

干杯, 启

2 个答案:

答案 0 :(得分:2)

我在http://jmeter.apache.org/usermanual/remote-test.html找到答案:

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.

答案 1 :(得分:0)

JMeter奴隶完全是独立的野兽,因此他们对彼此一无所知,因此两个节点都会产生200个TMP,因此你总共得到400个。添加额外节点将额外增加200个TMP。

尽管名称Constant Throughput Timer不必是“常量”,但您可以使用${__P(TPS,200)} jmeter -GTPS=100 -n -r -t ... 定义吞吐量默认值,并在通过以下方式开始测试时修改它: G命令行选项如:

const assert = require('assert');
const MongoClient = require('mongodb').MongoClient;

var const = 'mongodb://localhost:27017/test';

MongoClient.connect(url, function(err, db) {
    if (err) {
        console.log(err);
    }
    else {

        const mongoCommand = { copydb: 1, fromhost: "localhost", fromdb: "test", todb: "test_dup" };
        const admin = db.admin();

        admin.command(mongoCommand, function(commandErr, data) {
            if (!commandErr) {
                console.log(data);
            } else {
                console.log(commandErr.errmsg);
            }
            db.close();
        });
    }
});

甚至可以在使用__P() function运行测试时执行此操作。

请参阅Beanshell Server以了解有关JMeter Properties概念的更多信息。