Skip to content

logthrdestdrv: carry over fractional worker counts when computing partition stats#3

Closed
alltilla wants to merge 1 commit intoMrAnno:partition-statsfrom
alltilla:partition-stats-fractional-worker-carryover
Closed

logthrdestdrv: carry over fractional worker counts when computing partition stats#3
alltilla wants to merge 1 commit intoMrAnno:partition-statsfrom
alltilla:partition-stats-fractional-worker-carryover

Conversation

@alltilla
Copy link

@alltilla alltilla commented Dec 3, 2025

This is an alternative solution for dealing with the rounding errors of floor().

The floor() call can remove significant fractions in certain scenarios, e.g.:

20 workers, 10 partitions (even load), 1 wfo:

  • We retain 1 worker for the orphans
  • We have 19 workers left for 10 partitions => 1.9 workers/partition
  • floor(1.9) = 1 worker/partition
  • 0.9 workers are lost per partition, which becomes 9 at the end
  • The remaining 9 workers are given to a single partition
  • Nearly half of the workers are severely underutilized

Instead of accumulating all the rounding errors and giving it to the last partition, we can spread the rounding error to the following partition, which then spreads its rounding error to the next, etc.

@alltilla alltilla force-pushed the partition-stats-fractional-worker-carryover branch from a564704 to 111ecf8 Compare December 3, 2025 08:42
…tition stats

The floor() call can remove significant fractions
in certain scenarios, e.g.:

20 workers, 10 partitions, 1 wfo:
  - We retain 1 worker for the orphans.
  - We have 19 workers left for 10 partitions => 1.9 workers/partition
  - floor(1.9) = 1 worker/partition
  - 0.9 workers are lost per partition, which becomes 9 at the end
  - The remaining 9 workers are given to a single partition
  - Nearly half of the workers are severely underutilized

Instead of accumulating all the rounding errors
and giving it to the last partition, we can
spread the rounding error to the following
partition, which then spreads its rounding error
to the next, etc.

Signed-off-by: Attila Szakacs <[email protected]>
@alltilla alltilla force-pushed the partition-stats-fractional-worker-carryover branch from 111ecf8 to bc11639 Compare December 3, 2025 08:46
@MrAnno
Copy link
Owner

MrAnno commented Dec 3, 2025

I'd prefer review notes to my ongoing work over patches. This practice slowly eliminates the desire to contribute to AxoSyslog (especially in one's free time); this especially true for my other coworkers whose work previously had been rewritten.

@MrAnno MrAnno closed this Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants