logthrdest: support autoscaling partitions#855
Merged
alltilla merged 5 commits intoaxoflow:mainfrom Dec 3, 2025
Merged
Conversation
Contributor
This Pull Request introduces config grammar changesaxoflow/65c732858e01325a29dec2576cba7c5a408421ee -> MrAnno/partition-stats Details--- a/destination
+++ b/destination
axosyslog-otlp(
+ worker-partition-autoscaling(<yesno>)
+ worker-partition-autoscaling-wfo(<positive-integer>)
)
bigquery(
+ worker-partition-autoscaling(<yesno>)
+ worker-partition-autoscaling-wfo(<positive-integer>)
)
clickhouse(
+ worker-partition-autoscaling(<yesno>)
+ worker-partition-autoscaling-wfo(<positive-integer>)
)
google-pubsub-grpc(
+ worker-partition-autoscaling(<yesno>)
+ worker-partition-autoscaling-wfo(<positive-integer>)
)
http(
+ worker-partition-autoscaling(<yesno>)
+ worker-partition-autoscaling-wfo(<positive-integer>)
)
kafka-c(
+ worker-partition-autoscaling(<yesno>)
+ worker-partition-autoscaling-wfo(<positive-integer>)
)
loki(
+ worker-partition-autoscaling(<yesno>)
+ worker-partition-autoscaling-wfo(<positive-integer>)
)
mongodb(
+ worker-partition-autoscaling(<yesno>)
+ worker-partition-autoscaling-wfo(<positive-integer>)
)
opentelemetry(
+ worker-partition-autoscaling(<yesno>)
+ worker-partition-autoscaling-wfo(<positive-integer>)
)
redis(
+ worker-partition-autoscaling(<yesno>)
+ worker-partition-autoscaling-wfo(<positive-integer>)
)
syslog-ng-otlp(
+ worker-partition-autoscaling(<yesno>)
+ worker-partition-autoscaling-wfo(<positive-integer>)
)
|
dabfef8 to
de9f5f9
Compare
c2b6677 to
bb9258b
Compare
bb9258b to
be4f23c
Compare
MrAnno
added a commit
to MrAnno/axosyslog
that referenced
this pull request
Nov 26, 2025
Signed-off-by: László Várady <[email protected]>
Contributor
Author
|
MrAnno
added a commit
to MrAnno/axosyslog
that referenced
this pull request
Nov 26, 2025
Signed-off-by: László Várady <[email protected]>
be4f23c to
19a06d6
Compare
MrAnno
added a commit
to MrAnno/axosyslog
that referenced
this pull request
Nov 26, 2025
Signed-off-by: László Várady <[email protected]>
19a06d6 to
a923eed
Compare
Contributor
Author
|
My valgrind is broken, I'll ask someone to help me check memory stuff together. |
mitzkia
reviewed
Nov 28, 2025
Signed-off-by: László Várady <[email protected]>
Signed-off-by: László Várady <[email protected]>
Signed-off-by: László Várady <[email protected]>
Signed-off-by: László Várady <[email protected]>
9f2cc9b to
f889f39
Compare
Signed-off-by: László Várady <[email protected]>
alltilla
approved these changes
Dec 3, 2025
Member
alltilla
left a comment
There was a problem hiding this comment.
Only optional comments, we can merge this as is if you want.
|
|
||
| /* partition_stats_lock must be held when calling this method */ | ||
| static inline gboolean | ||
| _remove_if_partition_expired(Partition **p, GHashTableIter *iter, const struct timespec *now) |
Member
There was a problem hiding this comment.
[nitpick]
I think p can be a non-output variable?
| part->worker_idx = current_worker_idx; | ||
| gdouble partition_ratio = _get_partition_rate_ratio(part->rate, total_rate); | ||
| gdouble partition_workers = partition_ratio * free_workers; | ||
| part->num_of_workers = (gint) (0 + floor(partition_workers)); |
Member
There was a problem hiding this comment.
[optional]
This floor() call can have nearly a whole worker as a rounding error. I know that we accumulate it and give them to one partition, but I think we have other options too, that spread the error better between the remaining partitions. I have opened a PR with my suggested algorithm, kindly consider it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
worker-partition-key()is used to categorize messages into different batches,the messages are - by default - hashed into workers, which prevents them from being distributed across workers
efficiently, based on load.
The new
worker-partition-autoscaling(yes)option uses a 1-minute statistic to help distributehigh-traffic partitions among multiple workers, allowing each worker to maximize its batch size.
When using this autoscaling option, it is recommended to oversize the number of workers: set it higher than the
expected number of partitions.
Upper limit on the partitions table and falling back to hashing when misconfigured?