简体   繁体   English

Cadence 集群中活跃使用的线程数量非常多

[英]Very high number of threads in active use in Cadence cluster

While performing the load testing of the cadence cluster, we are seeing extremely high number of threads ( > 4000) and it constantly remains like this consuming high CPU and memory.在执行 cadence 集群的负载测试时,我们看到非常多的线程(> 4000),并且一直如此消耗大量 CPU 和内存。 It remains like this, when there are no external signals or active workflows.当没有外部信号或活动工作流时,它仍然是这样。 I have disabled the sticky workflow options so no workflow should be cached, instead the thread count is not going down.我已禁用粘性工作流选项,因此不应缓存任何工作流,而是线程数不会下降。 Is there any way to resolve this further ?有没有办法进一步解决这个问题?

I was able to identify the issue.我能够确定问题所在。 The issue was due to creation of multiple WorkflowClient per request.问题是由于每个请求创建了多个WorkflowClient Each workflow client bootstraps its own tasklist and thread pool to dispatch tasks.每个工作流客户端都引导自己的任务列表和线程池来分派任务。

In java based applications, we should create single workflow clients for each flow that we want to orchestrate.在基于 Java 的应用程序中,我们应该为要编排的每个流创建单个工作流客户端。 For example I was creating workflows to orchestrate order shipments in an e-commerce application, so I created single workflow clients, one for forward journey and other for reverse.例如,我正在创建工作流来协调电子商务应用程序中的订单发货,因此我创建了单个工作流客户端,一个用于正向旅程,另一个用于反向。 It worked like a charm.它就像一个魅力。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM