Skip to content

zero-cache: respect ZERO_CHANGE_STREAMER_QUEUE_SIZE_BACK_PRESSURE_THRESHOLD#5557

Open
Karavil wants to merge 11 commits intorocicorp:mainfrom
Karavil:change-streamer-queue-size-backpressure-threshold
Open

zero-cache: respect ZERO_CHANGE_STREAMER_QUEUE_SIZE_BACK_PRESSURE_THRESHOLD#5557
Karavil wants to merge 11 commits intorocicorp:mainfrom
Karavil:change-streamer-queue-size-backpressure-threshold

Conversation

@Karavil
Copy link
Contributor

@Karavil Karavil commented Feb 13, 2026

Adds change streamer config option queueSizeBackPressureThreshold.

Env var: ZERO_CHANGE_STREAMER_QUEUE_SIZE_BACK_PRESSURE_THRESHOLD

Behavior: if set, the change streamer applies back pressure when either the existing heap based queued bytes threshold is exceeded or the queued change count exceeds this threshold. Release requires falling below both thresholds.

@vercel
Copy link

vercel bot commented Feb 13, 2026

@Karavil is attempting to deploy a commit to the Rocicorp Team on Vercel.

A member of the Team first needs to authorize it.

@Karavil
Copy link
Contributor Author

Karavil commented Feb 13, 2026

Cleanup: removed duplicated 0.8 by introducing BACK_PRESSURE_RELEASE_RATIO constant in storer, and restored backward compatible initializeStreamer signature so tests and existing callsites do not need to pass undefined.

@Karavil
Copy link
Contributor Author

Karavil commented Feb 13, 2026

Tweaked #maybeReleaseBackPressure: added isBelowThreshold helper to remove duplication, and moved the release comment to describe the combined condition.

@Karavil
Copy link
Contributor Author

Karavil commented Feb 13, 2026

Moved the release comment above BACK_PRESSURE_RELEASE_RATIO and removed the in-condition comment that claimed a specific percent.

@Karavil
Copy link
Contributor Author

Karavil commented Feb 13, 2026

Tweaked #maybeReleaseBackPressure to precompute release thresholds once (releaseBytesThreshold, releaseQueueSizeThreshold) instead of multiplying by BACK_PRESSURE_RELEASE_RATIO multiple times.

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.

1 participant