# Why is there a lot of Ray:: IDLE in my ray process

**URL:** <https://discuss.ray.io/t/why-is-there-a-lot-of-ray-idle-in-my-ray-process/10395>\
**Category:** Ray Core\
**Created:** [April 27, 2023, 8:23am UTC](https://discuss.ray.io/t/why-is-there-a-lot-of-ray-idle-in-my-ray-process/10395 "2023-04-27T08:23:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![brosoul](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/brosoul/32/3979_2.png) [@brosoul](https://discuss.ray.io/u/brosoul)\
**Post date:** [April 27, 2023, 8:23am UTC](https://discuss.ray.io/t/why-is-there-a-lot-of-ray-idle-in-my-ray-process/10395/1 "2023-04-27T08:23:25Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/ray/original/2X/7/7c4f6fef6929fccbaf4356fb09707a8e1059f525.png)

As shown in the above figure, why are there many Ray:: IDLE in my ray process?

Is there any **elegant way** to terminate these IDLE without affecting the existing ray serve.

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [April 27, 2023, 1:56pm UTC](https://discuss.ray.io/t/why-is-there-a-lot-of-ray-idle-in-my-ray-process/10395/2 "2023-04-27T13:56:29Z")

</div>

It is expected to start IDLE workers to reduce worker startup time. They will be used as soon as you create serve replicas. Ray creates idle workers as many as number of cpus on the node by default when you start a new script.

If you really want to disable having IDLE workers, you can set env var RAY\_prestart\_worker\_first\_driver=0 when you create a cluster. E.g.,

```auto
prestart_worker_first_driver=0 ray start --head

```

---

<div class="post-metadata">

**Author:** ![XIE](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/xie/32/4315_2.png) [@XIE](https://discuss.ray.io/u/XIE)\
**Post date:** [April 27, 2023, 2:37pm UTC](https://discuss.ray.io/t/why-is-there-a-lot-of-ray-idle-in-my-ray-process/10395/3 "2023-04-27T14:37:14Z")

</div>

This is a good question. Maybe we could document it in an Q&A session of the ray OSS website.

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [April 27, 2023, 3:29pm UTC](https://discuss.ray.io/t/why-is-there-a-lot-of-ray-idle-in-my-ray-process/10395/4 "2023-04-27T15:29:27Z")

</div>

@XIE yeah for sure. I think we need to update the behavior of workers in the core documentation. We’ve been talking about this for a while, but it hasn’t happened yet

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [September 26, 2023, 8:44pm UTC](https://discuss.ray.io/t/why-is-there-a-lot-of-ray-idle-in-my-ray-process/10395/5 "2023-09-26T20:44:26Z")

</div>

> <https://github.com/ray-project/ray/issues/39876>
>
> \### Description
> 
> Currently, the behavior of worker process start / end is not we…ll documented. We should document the behavior clearly.
> 
> \### Link
> 
> \_No response\_

---

<div class="post-metadata">

**Author:** ![joso](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/joso/32/3745_2.png) [@joso](https://discuss.ray.io/u/joso)\
**Post date:** [August 6, 2024, 12:03pm UTC](https://discuss.ray.io/t/why-is-there-a-lot-of-ray-idle-in-my-ray-process/10395/6 "2024-08-06T12:03:40Z")

</div>

This env variable is not disabling ray::IDLE worker completely. They are only disabled when cluster is started for the first time.

This does not resolve hanging ray:IDLE worker which are left behind after a run.

---

<div class="post-metadata">

**Author:** ![Byrom](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@Byrom](https://discuss.ray.io/u/Byrom)\
**Post date:** [August 13, 2024, 11:50am UTC](https://discuss.ray.io/t/why-is-there-a-lot-of-ray-idle-in-my-ray-process/10395/7 "2024-08-13T11:50:20Z")

</div>

This might be quite a random contribution, but I noticed I had several ray::IDLE processes in my machine.  
Turns out when you have htop on and start up your ray processes they show up as ray::IDLE even when they are computing something.  
When I quit htop and restarted it it showed my ray processes with the proper ray::function\_name.  
When any worker process died and was restarted it also showed as ray::IDLE in htop (even when computing something) until I restarted htop.  
Maybe this is what happened to you?

---

<div class="post-metadata">

**Author:** ![joso](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/joso/32/3745_2.png) [@joso](https://discuss.ray.io/u/joso)\
**Post date:** [October 2, 2024, 11:11am UTC](https://discuss.ray.io/t/why-is-there-a-lot-of-ray-idle-in-my-ray-process/10395/8 "2024-10-02T11:11:02Z")

</div>

Thanks for the response but unfortunately this is not what’s happening. Ray Dashboard is also showing ray::IDLEs which are not computing anything since submitted job has finished. But then when starting a new job they either prevent new tasks from being scheduled or it flat-out crashes due to OOM error.

---

<div class="post-metadata">

**Author:** ![vadimkantorov](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/vadimkantorov/32/7951_2.png) [@vadimkantorov](https://discuss.ray.io/u/vadimkantorov)\
**Post date:** [May 11, 2025, 8:49am UTC](https://discuss.ray.io/t/why-is-there-a-lot-of-ray-idle-in-my-ray-process/10395/9 "2025-05-11T08:49:05Z")

</div>

During running ray-using [GitHub - Open-Reasoner-Zero/Open-Reasoner-Zero: Official Repo for Open-Reasoner-Zero](https://github.com/Open-Reasoner-Zero/Open-Reasoner-Zero), I’m getting a strange DeepSpeed printout (not detecting CUDA on a CUDA machine):

```auto
(pid=4720) [2025-05-11 08:23:40,898] [WARNING] [real_accelerator.py:194:get_accelerator] Setting accelerator to CPU. If you have GPU or other accelerator, we were unable to detect it.
(pid=4720) [2025-05-11 08:23:40,899] [INFO] [real_accelerator.py:239:get_accelerator] Setting ds_accelerator to cpu (auto detect)

```

When I look up this pid, I’m getting `ray::IDLE` in place of invokation command, so I can’t even understand where’s this printout coming from. Is there a way to understand what’s the actual Python script running in this previously (?) idle worker?

Basically, I’m looking to understand what is doing some ray process by a known PID, but the command in `ps aux` shows only `ray::IDLE`
