AWS 上的 gatling 压力测试,线程保持活跃

gatling stress testing on AWS, threads staying in active

我设置了两个 AMI(redhat) 实例,一个带有 ActiveMQ 5.11 代理,另一个带有一些压力测试工具(gatling w/Mqtt、mqtt-stres 等)。我在两个实例上都停止了 iptables 服务(防火墙)。 AWS 安全组允许端口 1883 用于 mqtt 消息传递。

运行 mqtt-stress.py 成功,它进行了往返,我从代理那里收到了一条消息。当我启动 Gatling 模拟时,所有线程都移动到 'Active' 状态并且永远不会进入 'Done'。我什至在与 Gatlin 相同的机器上设置了一个代理,并将模拟指向 'localhost',结果相同。 simulation.log 中没有任何内容。原始服务器上的 tcpdump 显示没有建立传入连接。这是模拟:

import io.gatling.core.Predef._
import org.fusesource.mqtt.client.QoS
import scala.concurrent.duration._

import com.github.mnogu.gatling.mqtt.Predef._

class BasicMqttSimulation extends Simulation {
  val mqttConf = mqtt
    // MQTT broker
    //.host("tcp://127.0.0.1:1883")
    .host("tcp://175.10.130.10:1883")

  val scn = scenario("MQTT Test")
    .exec(mqtt("request")
      // topic: "foo"
      // payload: "Hello"
      // QoS: AT_LEAST_ONCE
      // retain: false
      .publish("foo", "Hello", QoS.AT_LEAST_ONCE, retain = false))

  setUp(
    scn
      .inject(constantUsersPerSec(10) during(10 seconds)))
    .protocols(mqttConf)
}

关于如何进一步解决这个问题的任何提示?

重建实例并逐步测试,

sudo setenforce 0 # 无法在重启后存活

需要为 SElinux 添加规则。