如何在 mule 中找到用于分散聚集的最大线程活动

How to find max thread active for scatter-gather in mule

我正在使用 mule 版本 3.9。 我的应用程序使用 HTTP 侦听器组件 作为消息源并使用 scatter gather 从数据库收集数据。
在性能测试期间,抛出“Threadpoolexecutor 在 30000 MILLISECONDS (java.util.concurrent.RejectedExecutionException) 内未接受”。我认为这是由于没有足够的线程用于分散收集组件。

根据 mule 文档,Scatter-Gather 的 maxThreadsActive 是 Scatter-Gather 中的路由数 * 流的 maxThreadsActive。现在,如何找到流的 maxThreadsActive?没有为流定义处理策略。请帮助。

阅读 default threading profile documentation:

maxThreadsActive The maximum number of threads to use.

Type: integer
Required: no
Default: 16

话虽如此,我建议与其增加线程数量,不如分析线程转储以了解现有线程在忙时都在做什么。可能您有一些操作花费的时间比预期的要长(数据库查询?)。增加线程数应该通过性能测试来评估,以了解改进和成本。线程不是免费的,它们使用内存和 CPU.