# Reading number of Ray workers from Python?

**URL:** <https://discuss.ray.io/t/reading-number-of-ray-workers-from-python/22>\
**Category:** Ray Core\
**Created:** [October 30, 2020, 9:40pm UTC](https://discuss.ray.io/t/reading-number-of-ray-workers-from-python/22 "2020-10-30T21:40:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![will](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/will/32/2127_2.png) [@will](https://discuss.ray.io/u/will)\
**Post date:** [October 30, 2020, 9:40pm UTC](https://discuss.ray.io/t/reading-number-of-ray-workers-from-python/22/1 "2020-10-30T21:40:30Z")

</div>

I’d like to periodically check the number of ray workers and associated CPUs / RAM available in my cluster from Python.

I know today I can do this from the ray dashboard with:

```
$ ray dashboard

```

but I’d like to do it programmatically.

What is the best way to access this information from within a running Ray Python script?

---

<div class="post-metadata">

**Author:** ![rkn](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/rkn/32/8_2.png) [@rkn](https://discuss.ray.io/u/rkn)\
**Post date:** [November 2, 2020, 5:33am UTC](https://discuss.ray.io/t/reading-number-of-ray-workers-from-python/22/2 "2020-11-02T05:33:45Z")

</div>

You can use the `ray.available_resources()` API to check the available resources in the Ray cluster. This is a reflection of the resources that the Ray scheduler has reserved for running tasks and actors. It is not a reflection of actual physical resource utilization.
