# Which metric should be used for HPA activity workers in Kubernetes?

**URL:** <https://community.temporal.io/t/which-metric-should-be-used-for-hpa-activity-workers-in-kubernetes/4019>\
**Category:** Community Support\
**Tags:** php-sdk\
**Created:** [February 17, 2022, 4:27pm UTC](https://community.temporal.io/t/which-metric-should-be-used-for-hpa-activity-workers-in-kubernetes/4019 "2022-02-17T16:27:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zigmas\_Satkevicius](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/zigmas_satkevicius/32/722_2.png) [@Zigmas\_Satkevicius](https://community.temporal.io/u/Zigmas_Satkevicius)\
**Post date:** [February 17, 2022, 4:27pm UTC](https://community.temporal.io/t/which-metric-should-be-used-for-hpa-activity-workers-in-kubernetes/4019/1 "2022-02-17T16:27:27Z")

</div>

Hello,

I’m wondering how to autoscale our workers using HPA.

So, let’s say we have ServiceA, ServiceB, we’re running PHP and using roadrunner. ServiceB needs more workers. Which metric would directly represent that. `temporal_activity_schedule_to_start_latency` ? `temporal_activity_poll_no_task`? Would “backlog” figure represent it as in taskqueue describe rpc call (`tctl adm tq describe --taskqueue serviceB_queue`)?

In the SQS we are using `ApproximateNumberOfMessagesVisible`.

It seems I need far less workers with temporal/roadrunner than with regular PHP enqueue (SQS) adapter, or I’m missing something. Which would be awesome news actuall 😅

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [February 18, 2022, 3:00pm UTC](https://community.temporal.io/t/which-metric-should-be-used-for-hpa-activity-workers-in-kubernetes/4019/2 "2022-02-18T15:00:08Z")

</div>

I would start with the [worker tuning guide](https://docs.temporal.io/docs/operation/how-to-tune-workers/) in docs. It goes into metrics as well.

---

<div class="post-metadata">

**Author:** ![Zigmas\_Satkevicius](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/zigmas_satkevicius/32/722_2.png) [@Zigmas\_Satkevicius](https://community.temporal.io/u/Zigmas_Satkevicius)\
**Post date:** [February 19, 2022, 11:27am UTC](https://community.temporal.io/t/which-metric-should-be-used-for-hpa-activity-workers-in-kubernetes/4019/3 "2022-02-19T11:27:10Z")

</div>

To anyone more interested in current problems with scaling roadrunner workers for temporal read here [[🐛 BUG]: Metric `temporal_activity_schedule_to_start_latency` useless with RR? · Issue #183 · temporalio/roadrunner-temporal · GitHub](https://github.com/temporalio/roadrunner-temporal/issues/183) 🙃
