Skip to content

feat(log-stream): send up to 10 products per datacenter per tick - #290

Draft
alukach wants to merge 1 commit into
source-cooperative:mainfrom
alukach:worktree-globe-product-count
Draft

alukach wants to merge 1 commit into
source-cooperative:mainfrom
alukach:worktree-globe-product-count

Conversation

@alukach

@alukach alukach commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

What

The hub now sends up to 10 products per datacenter per tick instead of 5 (MAX_PRODUCTS_PER_COLO). Production and staging set it in workers/public-log-stream/wrangler.toml. Previews now set it too, in wrangler.preview.toml, instead of falling back to the code default of 5.

Why

A tick carries only what one datacenter served in one 500 ms slot, so its top five products are a thin slice. The globe on source.coop is gaining an accumulated per-datacenter popularity view built from successive ticks; ten products per tick gives it a better picture. Nothing else about the message changes.

Payload

A product entry is about 25 bytes, so the worst case is about 125 extra bytes per datacenter per tick. Only a datacenter that served more than five distinct products in one slot sends more than it does today, which is a few busy datacenters rather than the 250-odd that are active at any time. I have not measured the real tick size. Messages from the Durable Object to browsers are not billed.

Not changed

🤖 Generated with Claude Code

A tick carries only the products one datacenter served in that 500 ms slot, so
the top five is a thin slice. Viewers that accumulate ticks over time to show
what is popular at a datacenter get a better picture from ten. Previews now set
the same value instead of falling back to the code default.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch had an error being deployed

1 failed deployment
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