# Best way to config ray workers

**URL:** <https://discuss.ray.io/t/best-way-to-config-ray-workers/1028>\
**Category:** Ray Core\
**Created:** [February 26, 2021, 12:44am UTC](https://discuss.ray.io/t/best-way-to-config-ray-workers/1028 "2021-02-26T00:44:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![xunzhang](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/xunzhang/32/107_2.png) [@xunzhang](https://discuss.ray.io/u/xunzhang)\
**Post date:** [February 26, 2021, 12:44am UTC](https://discuss.ray.io/t/best-way-to-config-ray-workers/1028/1 "2021-02-26T00:44:51Z")

</div>

Say if I have 64Cores and 128GB Memory in total, what is the best practice to partition to ray workers?

Way1: 64 workers with 1Core 2GB Memory  
Way2: 1 worker with 64Cores 128GB Memory.

If I specify `ray.remote(num_cpus=1, memory=512M)` and I have 64 tasks, in Way2, will the 64 tasks be scheduled for the worker simultaneously? If that is the case, does that mean it is more flexible to assign a large resources to Ray workers?

---

<div class="post-metadata">

**Author:** ![xunzhang](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/xunzhang/32/107_2.png) [@xunzhang](https://discuss.ray.io/u/xunzhang)\
**Post date:** [February 26, 2021, 12:45am UTC](https://discuss.ray.io/t/best-way-to-config-ray-workers/1028/2 "2021-02-26T00:45:22Z")

</div>

cc @sangcho can you please help to answer this? Thanks!

---

<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:** [February 26, 2021, 1:32am UTC](https://discuss.ray.io/t/best-way-to-config-ray-workers/1028/3 "2021-02-26T01:32:10Z")

</div>

When you say ray workers, you meant the machine or process?

---

<div class="post-metadata">

**Author:** ![xunzhang](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/xunzhang/32/107_2.png) [@xunzhang](https://discuss.ray.io/u/xunzhang)\
**Post date:** [February 26, 2021, 1:42am UTC](https://discuss.ray.io/t/best-way-to-config-ray-workers/1028/4 "2021-02-26T01:42:34Z")

</div>

I use k8s deployment, each pod will start a ray worker node

---

<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:** [February 26, 2021, 2:01am UTC](https://discuss.ray.io/t/best-way-to-config-ray-workers/1028/5 "2021-02-26T02:01:51Z")

</div>

I think it is better to use a larger node with more resources. Also, it is always better to have at least 4 cores for each ray worker node (because you will have components for ray itself).

---

<div class="post-metadata">

**Author:** ![xunzhang](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/xunzhang/32/107_2.png) [@xunzhang](https://discuss.ray.io/u/xunzhang)\
**Post date:** [February 26, 2021, 2:21am UTC](https://discuss.ray.io/t/best-way-to-config-ray-workers/1028/6 "2021-02-26T02:21:14Z")

</div>

ok, make sense. So if I specify `ray.remote(num_cpus=1, memory=512M)`, and each worker has 4 cores, for example, it is possible to launch 4 actors in that worker right?

---

<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:** [February 26, 2021, 2:22am UTC](https://discuss.ray.io/t/best-way-to-config-ray-workers/1028/7 "2021-02-26T02:22:31Z")

</div>

Yes, that’s correct!
