在dask中为LocalCluster设置内存参数的正确方法

时间:2019-04-21 15:47:01

标签: dask dask-distributed

我尝试了以下代码,

obj

但这不起作用

[""]

正确的呼叫方式是什么? LocalCluster似乎也不在乎from dask.distributed import Client, LocalCluster worker_kwargs = { 'memory_limit': '2G', 'memory_target_fraction': 0.6, 'memory_spill_fraction': 0.7, 'memory_pause_fraction': 0.8, 'memory_terminate_fraction': 0.95, } cluster = LocalCluster(ip='0.0.0.0', n_workers=8, **worker_kwargs)

我已经阅读了以下这些帖子:

  1. https://github.com/dask/distributed/issues/2456
  2. https://github.com/dask/distributed/issues/1521

1 个答案:

答案 0 :(得分:1)

似乎是版本问题。将dask更新为1.2.0即可解决此问题。

from dask.distributed import Client, LocalCluster
worker_kwargs = {
    'memory_limit': '2G',
    'memory_target_fraction': 0.6,
    'memory_spill_fraction': 0.7,
    'memory_pause_fraction': 0.8,
    # 'memory_terminate_fraction': 0.95,
}
cluster = LocalCluster(ip='0.0.0.0', n_workers=8, **worker_kwargs)

有效