# Worker integration with KEDA scaling

**URL:** https://community.temporal.io/t/worker-integration-with-keda-scaling/8056
**Category:** Community Support
**Tags:** kubernetes
**Created:** [April 27, 2023, 6:17pm UTC](https://community.temporal.io/t/worker-integration-with-keda-scaling/8056 "2023-04-27T18:17:07Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![rocketraman](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/rocketraman/32/3687_2.png) [@rocketraman](https://community.temporal.io/u/rocketraman)
#### Post date: [April 27, 2023, 6:17pm UTC](https://community.temporal.io/t/worker-integration-with-keda-scaling/8056/1 "2023-04-27T18:17:07Z")

</div>

[KEDA](https://keda.sh/docs/2.10/concepts/) allows Kubernetes deployments to be scaled based on workloads.

A scaler can be created that monitors particular resources – in this case possibly a Temporal worker queue length, and can thus scale a deployment based on that information, even to zero. There are [many examples of other system-specific scalers](https://keda.sh/docs/2.10/scalers/).

A KEDA-based Temporal Scaler would be great to allow scaling resources and maximizing cost effectiveness of an infrastructure in which some services are only used occassionally, or have inconsistent resource requirements over time.

A CPU scaler can be used as a stand-in but that will never scale to zero, whereas a Temporal-specific scaler could scale to zero if there were no entries pending processing in a worker queue.

Is there any plan to provide such functionality out of the box? If not, what would be the best way to go about implementing one? I see various latency metrics in the temporal docs that could potentially be used, but it will be tricky and error-prone to attempt to infer a queue size from these, as a higher latency could just as easily mean more workers are required as less.

---

<div class="post-metadata">

### Author: ![Febin\_Sathar](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/febin_sathar/32/4130_2.png) [@Febin\_Sathar](https://community.temporal.io/u/Febin_Sathar)
#### Post date: [August 8, 2023, 3:21am UTC](https://community.temporal.io/t/worker-integration-with-keda-scaling/8056/2 "2023-08-08T03:21:48Z")

</div>

> <https://github.com/kedacore/keda/pull/4863/files>
>
> \<!-- Thank you for contributing!
> 
> Read more about how you can contribute …in our contribution guide:
> https://github.com/kedacore/keda/blob/main/CONTRIBUTING.md
> \--\>
> 
> Implement a temporal scaler 
> 
> \### Checklist
> 
> \- \[x\] When introducing a new scaler, I agree with the \[scaling governance policy\](https://github.com/kedacore/governance/blob/main/SCALERS.md)
> \- \[x\] I have verified that my change is according to the \[deprecations & breaking changes policy\](https://github.com/kedacore/governance/blob/main/DEPRECATIONS.md)
> \- \[x\] Tests have been added
> \- \[x\] Changelog has been updated and is aligned with our \[changelog requirements\](https://github.com/kedacore/keda/blob/main/CONTRIBUTING.md#Changelog)
> \- \[\] A PR is opened to update our Helm chart (\[repo\](https://github.com/kedacore/charts)) \*(if applicable, ie. when deployment manifests are modified)\*
> \- \[\] A PR is opened to update the documentation on (\[repo\](https://github.com/kedacore/keda-docs)) \*(if applicable)\*
> \- \[x\] Commits are signed with Developer Certificate of Origin (DCO - \[learn more\](https://github.com/kedacore/keda/blob/main/CONTRIBUTING.md#developer-certificate-of-origin-signing-your-work))
> 
> \<!--
> Make sure to link the related issue for this change
> If it requires multiple PRs and/or a PR on another repo as well, please use "Relates to" instead.
> \--\>
> Fixes #4724 
> 
> \<!--
> Make sure to link the related PRs for changes such as documentation & Helm charts
> \--\>
> Relates to #

---

<div class="post-metadata">

### Author: ![rocketraman](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/rocketraman/32/3687_2.png) [@rocketraman](https://community.temporal.io/u/rocketraman)
#### Post date: [January 8, 2024, 1:11pm UTC](https://community.temporal.io/t/worker-integration-with-keda-scaling/8056/3 "2024-01-08T13:11:57Z")

</div>

Unfortunately the PR above is stalled because the author did not implement it in the way recommended by the Temporal folks.

---

<div class="post-metadata">

### Author: ![temporal\_angie](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/temporal_angie/32/5640_2.png) [@temporal\_angie](https://community.temporal.io/u/temporal_angie)
#### Post date: [January 20, 2025, 6:05pm UTC](https://community.temporal.io/t/worker-integration-with-keda-scaling/8056/4 "2025-01-20T18:05:12Z")

</div>

Happy anniversary to the last update of this post! 😉

Note that this effort has been resurrected and has some recent comment by maintainers: [add scaler for temporal by Prajithp · Pull Request #6191 · kedacore/keda · GitHub](https://github.com/kedacore/keda/pull/6191)

---

<div class="post-metadata">

### Author: ![Stephen\_Solka](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/stephen_solka/32/6551_2.png) [@Stephen\_Solka](https://community.temporal.io/u/Stephen_Solka)
#### Post date: [March 30, 2025, 11:40pm UTC](https://community.temporal.io/t/worker-integration-with-keda-scaling/8056/5 "2025-03-30T23:40:01Z")

</div>

It merged and its slated to go out in 2.17!!!

> <https://github.com/kedacore/keda/pull/6191#pullrequestreview-2600182368>
>
> Implement a temporal scaler
> 
> 
> \### Checklist
> 
> \- \[x\] When introducing a new s…caler, I agree with the \[scaling governance policy\](https://github.com/kedacore/governance/blob/main/SCALERS.md)
> \- \[x\] Tests have been added
> \- \[x\] Commits are signed with Developer Certificate of Origin (DCO - \[learn more\](https://github.com/kedacore/keda/blob/main/CONTRIBUTING.md#developer-certificate-of-origin-signing-your-work))
> \- \[x\] I have verified that my change is according to the \[deprecations & breaking changes policy\](https://github.com/kedacore/governance/blob/main/DEPRECATIONS.md)
> \- \[N/A\] A PR is opened to update our Helm chart (\[repo\](https://github.com/kedacore/charts)) \*(if applicable, ie. when deployment manifests are modified)\*
> \- \[x\] Changelog has been updated and is aligned with our \[changelog requirements\](https://github.com/kedacore/keda/blob/main/CONTRIBUTING.md#Changelog)
> \- \[x\] A PR is opened to update the documentation on (\[repo\](https://github.com/kedacore/keda-docs)) \*(if applicable)\*
> 
> Docs: https://github.com/kedacore/keda-docs/pull/1207
> 
> 
> Fixes #4724

 ![IMG_0120](https://us1.discourse-cdn.com/flex016/uploads/temporal/original/2X/4/42a905f4ce1e0edfa5bb569f1e2bc73ca5081209.png)

---

<div class="post-metadata">

### Author: ![temporal\_angie](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/temporal_angie/32/5640_2.png) [@temporal\_angie](https://community.temporal.io/u/temporal_angie)
#### Post date: [April 8, 2025, 5:33pm UTC](https://community.temporal.io/t/worker-integration-with-keda-scaling/8056/6 "2025-04-08T17:33:55Z")

</div>

Aaannnddd… [KEDA 2.17.0](https://github.com/kedacore/keda/releases/tag/v2.17.0) has been tagged! 😍

 ![Screenshot 2025-04-08 at 10.25.49 AM](https://us1.discourse-cdn.com/flex016/uploads/temporal/original/2X/1/1dfd930bd54978527be1dca831c13e7942dc2dd0.png)
