Skip to content

Add EWMA queue consumer autoscaling simulator#54

Open
02strich wants to merge 1 commit into
mainfrom
stefan/ewma
Open

Add EWMA queue consumer autoscaling simulator#54
02strich wants to merge 1 commit into
mainfrom
stefan/ewma

Conversation

@02strich
Copy link
Copy Markdown
Collaborator

Adds a browser-based discrete-event simulator under docs/simulators/service-ewma/ that models the EWMA-based queue consumer scaling algorithm, along with a SPEC.md documenting the algorithm's inputs, state, capacity estimate, no-sync decision, and cadence decision logic.

This EWMA algorithm it so far the best candidate for scaling worker set compute providers.

@02strich 02strich marked this pull request as ready for review May 28, 2026 00:20
@02strich 02strich requested a review from a team as a code owner May 28, 2026 00:20
Comment thread docs/simulators/service-ewma/SPEC.md Outdated
@@ -0,0 +1,161 @@
# Queue Consumer Scaling Algorithm Spec

This document specifies the queue consumer scaling algorithm.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems odd to have the directory called service-ewma but the top heading of this file be Queue Consumer Scaling Algorithm Spec. Perhaps it's worth doing a few things here:

  1. Change the name of the directory to consumer-ewma or queue-poller-ewma
  2. Add a paragraph to the top of this file explaining that the algorithm described herein examines the number of consumers polling a task queue over a set time window and uses an Exponential Weighted Moving Average (EWMA) formula to recommend adjustments in the number of pollers.
  3. Add a link or two to background documentation on EWMA.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updated the folder name and the title of the doc (those were working titles). In a follow-up PR I'll update the remaining simulator folders to fit better.

Also added a bit of intro text to cover the high-level.

Comment thread docs/simulators/service-ewma/SPEC.md Outdated

## Non-Goals

The algorithm intentionally does not use:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that Claude put a lot of this together, but it would be good to include an explanation of why the algorithm intentionally does not use these things in its evaluation. For instance, when I read the below list, I immediately asked myself "hold up... why wouldn't we want to take backlog length into account for the no-sync scale-up decision?"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually unrelated to Claude and more about this being a spec, which I originally started without any reasoning in it. That said, good feedback so added a bit more reasoning :)

Adds a browser-based discrete-event simulator under docs/simulators/workerset-ewma/ that models the EWMA-based worker set scaling algorithm, along with a SPEC.md documenting the algorithm's inputs, state, capacity estimate, no-sync decision, and cadence decision logic.
Copy link
Copy Markdown
Contributor

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks @02strich :)

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