python - Dask分布式: How to computationally recognize if worker is idling?

标签 python dask distributed dask-distributed

我想监视 dask 工作人员并在它们陷入空闲状态时重新启动它们。 有没有办法检测空闲的 worker ,例如通过计算worker在最后一分钟的平均CPU利用率?

最佳答案

您可能想查看 Scheduler.workers 中的调度程序状态

尝试

workers = client.run(lambda dask_scheduler: dask_scheduler.workers)

然后查看每个WorkerState对象的.metrics属性

{address: ws.metrics["cpu"] for address, ws in workers.items()}

(这里我把CPU拔出来了,但是里面有很多信息)

您可能还想了解自适应调度

关于python - Dask分布式: How to computationally recognize if worker is idling?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64561884/

相关文章:

python - python中的for循环(简单)

pandas - 让 Pandas DataFrame apply() 使用所有核心?

java - 无法接收 UDP 数据报

python - Dask 数据帧 : Can `set_index` put a single index into multiple partitions?

python - read_csv 将大型 csv 文件字段加载为对象

java - 以C/C++和其他语言重现Java原语hashCode逻辑的库

c++ - 可以分发或并行处理顺序程序吗?

python - 通过python访问API时出现403禁止的奇怪错误

python - 将元组 append 到元组

python - file.tell() 不一致