# Get number of active workers

**URL:** <https://discuss.ray.io/t/get-number-of-active-workers/2998>\
**Category:** Dashboard, Monitoring & Debugging\
**Created:** [July 23, 2021, 9:26pm UTC](https://discuss.ray.io/t/get-number-of-active-workers/2998 "2021-07-23T21:26:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ItsMeKe](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/itsmeke/32/1318_2.png) [@ItsMeKe](https://discuss.ray.io/u/ItsMeKe)\
**Post date:** [July 23, 2021, 9:26pm UTC](https://discuss.ray.io/t/get-number-of-active-workers/2998/1 "2021-07-23T21:26:22Z")

</div>

Is there a way to get the number of active and idle workers, I know the information is available in the web UI, but I couldn’t find any Python API calls.

---

<div class="post-metadata">

**Author:** ![rliaw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/rliaw/32/24_2.png) [@rliaw](https://discuss.ray.io/u/rliaw)\
**Post date:** [July 25, 2021, 2:03am UTC](https://discuss.ray.io/t/get-number-of-active-workers/2998/2 "2021-07-25T02:03:16Z")

</div>

Hmm this is a nice feature request. What are you trying to do?

Right now there’s a call for `ray.available_resources()` and `ray.cluster_resources()` that might be semi-sufficient?

---

<div class="post-metadata">

**Author:** ![ItsMeKe](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/itsmeke/32/1318_2.png) [@ItsMeKe](https://discuss.ray.io/u/ItsMeKe)\
**Post date:** [July 25, 2021, 6:44pm UTC](https://discuss.ray.io/t/get-number-of-active-workers/2998/3 "2021-07-25T18:44:53Z")

</div>

I want to dynamically switch between parallel processing and single processing depending on the workload, so I can sidestep any unnecessary overhead. I think I can make do with ray.available\_resources(), thank you.
