如何在 Hazelcast Imap 过滤器期间控制处理器数量

问题描述

我是 Hazelcast 的新手。当在 HazelCast Jet 管道上触发带谓词的 Imap 过滤器时,在 VDI 中,我看到 porcessors 计数仅为 2,而在我的机器上,我看到 12 个 porcessors。

当只有 2 个处理器时,过滤作业完成得非常快。但是当我在我的机器上看到 12 个处理器时,过滤器作业会持续运行更长的时间,并不断记录一行 Hazelcast healthmonitor 日志并超时。我认为这就是问题所在。

从我的搜索中,我了解到 Hazelcast 创建了基于 CPU 的处理器数量。我如何控制这个处理器数量。

以下是创建 Hazelcast jet 客户端并在管道上应用 IMap 过滤器时的日志行。

请原谅,由于对 Hazelcast 的了解有限,我无法清楚地描述问题。

Jun 08,2021 9:31:20 PM com.hazelcast.internal.diagnostics.HealthMonitor
INFO: [*xxx.xx.xxx.xxx*]:5701 [jet] [3.1] **processors=12**,physical.memory.total=32.0G,physical.memory.free=224.8M,swap.space.total=2.0G,swap.space.free=716.5M,heap.memory.used=110.4M,heap.memory.free=182.1M,heap.memory.total=292.5M,heap.memory.max=7.1G,heap.memory.used/total=37.74%,heap.memory.used/max=1.52%,minor.gc.count=4,minor.gc.time=75ms,major.gc.count=2,major.gc.time=129ms,load.process=3.01%,load.system=93.62%,load.systemAverage=9.20,thread.count=78,thread.peakCount=78,cluster.timeDiff=0,event.q.size=0,executor.q.async.size=0,executor.q.client.size=0,executor.q.client.query.size=0,executor.q.client.blocking.size=0,executor.q.query.size=0,executor.q.scheduled.size=0,executor.q.io.size=0,executor.q.system.size=0,executor.q.operations.size=0,executor.q.priorityOperation.size=0,operations.completed.count=392,executor.q.mapLoad.size=0,executor.q.mapLoadAllKeys.size=0,executor.q.cluster.size=0,executor.q.response.size=0,operations.running.count=0,operations.pending.invocations.percentage=0.00%,operations.pending.invocations.count=2,proxy.count=8,clientEndpoint.count=0,connection.active.count=0,client.connection.count=0,connection.count=0

解决方法

我猜 @Stateful(scopes = {Scope.LOCAL,Scope.CLUSTER},description = "After performing a listing of files,the timestamp of the newest file is stored. " + "This allows the Processor to list only files that have been added or modified after " + "this date the next time that the Processor is run. Whether the state is stored with a Local or Cluster scope depends on the value of the " + "<Input Directory Location> property.") 是一个红鲱鱼 - 这只是 processors=12 的值。

从我的搜索中,我了解到 Hazelcast 创建了基于 CPU 的处理器数量

这可能是指 Jet 并行处理器的数量。您可以通过在流水线中设置 Runtime.availableProcessors() 来控制并行处理器的数量。

当系统出现异常负载时,会记录来自 Health Monitor 的一行。它可能是由系统中的某些其他进程使 CPU 达到最大值引起的。你的问题没有提供足够的信息来猜测。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...