2

我想将 jboss 的 HTTP 侦听器线程监控为 7。我该怎么做?是否有任何 MBean,女巫允许这样做?

Web 子系统仅包含一般信息,但我想监控:

  • http-thread-max
  • http-thread-current
  • http-thread-busy
  • http-thread-spare-max
  • http-thread-spare-min
4

2 回答 2

3

是的,您可以使用 Mbean 进行线程池监控:

另外,查看jBoss 控制台,我认为应该有一个带有线程池的选项卡 - 列出大小、业务等。

作为最后的手段,收集线程转储并亲自查看。

于 2013-06-01T00:19:44.973 回答
1

我需要获取有关 HttpThreads 的信息,而不仅仅是 jvm 线程。我修改了standalone.xml 的线程子系统,并通过Jboss DMR 我得到了http 线程指标。

ModelNode request = new ModelNode();
request.get(ClientConstants.OP).set("read-resource");
request.get(ClientConstants.OP_ADDR).add("subsystem", "threads");
request.get("recursive").set(true);
request.get("include-runtime").set(true);
final ModelNode response = client.execute(new OperationBuilder(request).build());
return response.get(ClientConstants.RESULT).get("bounded-queue-thread-pool").get("http_queue");

Standalone.xml 线程子系统如下所示:

<subsystem xmlns="urn:jboss:domain:threads:1.1">
<thread-factory name="my_tf" group-name="group1" thread-name-pattern="my_tf_" priority="1"/>
<bounded-queue-thread-pool name="http_queue" allow-core-timeout="true">
<core-threads count="100"/>
<queue-length count="50"/>
<max-threads count="200"/>
<keepalive-time time="30" unit="minutes"/>
<thread-factory name="my_tf"/>
</bounded-queue-thread-pool>
</subsystem>
于 2013-06-05T12:41:20.427 回答