Skip to content

Kafka Partitions Per Pod Scaling #2581

@gabrieljones

Description

@gabrieljones

Proposal

Enhance the Kafka Scaler or create a new KEDA Scaler to support scaling Kafka by partitions per pod as opposed to simple increase in pod count.

Use-Case

Say I have 12 partitions for my topic.
At 3 pods I will have four partitions per pod:
4 + 4 + 4 = 12
At 4 pods I will have three partitions per pod:
3 + 3 + 3 + 3 = 12
If I naively scale to 5 pods, I will end up with 3 pods with 2 partitions each and 2 pods with still 3 partitions each:
2 + 2 + 2 + 3 + 3 = 12
To scale correctly I need to jump from 4 pods directly to 6 pods:
2 + 2 + 2 + 2 + 2 + 2 = 12
And instead of scaling to 7, 8, 9, 10, or 11, it should scale directly from 6 to 12.
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 12

As such the list of valid scale targets is not a simple sequence from 0 to 12. It is rather a sequence of the divisors of the partition count:
0, 1, 2, 3, 4, 6, 12

Anything else?

No response

Metadata

Metadata

Assignees

Labels

feature-requestAll issues for new features that have not been committed toneeds-discussionstale-bot-ignoreAll issues that should not be automatically closed by our stale bot

Type

No type

Projects

Status

Ready To Ship

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions