我在 EC2 上运行 ray。我在 c5.large 实例上运行工作程序,该实例具有约 4G 的 RAM。
当我运行许多作业时,我看到以下错误消息:
File "python/ray/_raylet.pyx", line 631, in ray._raylet.execute_task
File "/home/ubuntu/project/env/lib/python3.6/site-packages/ray/memory_monitor.py", line 126, in raise_if_low_memory
self.error_threshold))
ray.memory_monitor.RayOutOfMemoryError: More than 95% of the memory on node ip-172-31-43-111 is used (3.47 / 3.65 GB). The top 10 memory consumers are:
PID MEM COMMAND
21183 0.21GiB ray::IDLE
21185 0.21GiB ray::IDLE
21222 0.21GiB ray::IDLE
21260 0.21GiB ray::IDLE
21149 0.21GiB ray::IDLE
21298 0.21GiB ray::IDLE
21130 0.21GiB ray::IDLE
21148 0.21GiB ray::IDLE
21225 0.21GiB ray::IDLE
21257 0.21GiB ray::IDLE
In addition, up to 0.0 GiB of shared memory is currently being used by the Ray object store. You can set the object store size with the `object_store_memory` parameter when starting Ray, and the max Redis size with `redis_max_memory`. Note that Ray assumes all system memory is available for use by workers. If your system has other applications running, you should manually set these memory limits to a lower value.
Run Code Online (Sandbox Code Playgroud)
memory = 2000*1024*1024我正在使用和运行我的光线任务max_calls=1,因此盒子上同时不应有超过 2 个进程。
这些ray::IDLE流程是什么以及如何阻止我的员工出现 OOM?
使用射线0.8.1
小智 9
ray:IDLE 是留在处理池中的空闲进程。(Ray 这样做是为了减少进程启动时间)。它们每个都占用大约 0.21GB 内存,因为即使是空闲进程也需要使用一些内存(例如,它应该运行 python 解释器)。
您可以通过两件事来缓解这个问题。1. 将num_cpus的参数设置ray_init得较低(如 2~3),这样您将只有 2~3 个进程可用。2. 您应该考虑系统内存。正如您所看到的,Ray 不仅将内存用于任务,还用于其系统组件,例如 raylet 或 idel 进程。如果您的机器有 4GB 内存,并且您的 2 个任务使用 2GB 内存并在该机器上进行调度,则会导致 OOM 问题,因为有额外的进程会消耗额外的内存。
为了避免内存问题,您可以扩展集群(使用更大的机器或多台机器),或者减少任务的内存使用量。
| 归档时间: |
|
| 查看次数: |
6467 次 |
| 最近记录: |