Decompose: Documented concurrency contract (throughput, per-request bounds, failure semantics) — Phase 1: Throughput answers (questions 1, 5, 6) #69

Closed
opened 2026-06-22 16:31:50 +00:00 by Mark · 0 comments
Owner

Phase 1: Throughput answers (questions 1, 5, 6)

Goal: Lock the throughput policy.

Specifically:

  1. Max concurrent digitize requests? Answer: 4 (= N CPU cores on
    the target box; configurable via WORKER_POOL_SIZE).
  2. Queue ordering? Answer: FIFO. No priority by user or by input
    size.
  3. Backpressure signal? Answer: HTTP 503 with Retry-After: N
    header, where N is the p50 queue wait time. Document the exact
    header shape.

Files:

  • New: docs/concurrency.md (initial version with these 3 questions
    answered; the other 4 follow in P2/P3)
  • Modify: docs/service/operations.md (issue #40 P2) to reference
    the concurrency policy

Acceptance:

  • docs/concurrency.md has a section per answered question with the
    value, the rationale, and the source (benchmark, calculation, or
    decision doc).
  • The values are testable: a load test can assert "5 concurrent
    requests get 503 with Retry-After" against the spec.
  • The ThreadCraft team agrees on the values.

Why first: throughput answers constrain the design of the worker
pool and the request queue. They should be locked before any service
code is written.



Decomposed from easystitch#43

## Phase 1: Throughput answers (questions 1, 5, 6) **Goal:** Lock the throughput policy. **Specifically:** 1. **Max concurrent digitize requests?** Answer: 4 (= N CPU cores on the target box; configurable via `WORKER_POOL_SIZE`). 5. **Queue ordering?** Answer: FIFO. No priority by user or by input size. 6. **Backpressure signal?** Answer: HTTP 503 with `Retry-After: N` header, where N is the p50 queue wait time. Document the exact header shape. **Files:** - New: `docs/concurrency.md` (initial version with these 3 questions answered; the other 4 follow in P2/P3) - Modify: `docs/service/operations.md` (issue #40 P2) to reference the concurrency policy **Acceptance:** - `docs/concurrency.md` has a section per answered question with the value, the rationale, and the source (benchmark, calculation, or decision doc). - The values are testable: a load test can assert "5 concurrent requests get 503 with Retry-After" against the spec. - The ThreadCraft team agrees on the values. **Why first:** throughput answers constrain the design of the worker pool and the request queue. They should be locked before any service code is written. --- --- _Decomposed from [easystitch#43](https://forgejo.tail018ac4.ts.net/Mark/easystitch/issues/43)_
Mark 2026-06-23 16:17:33 +00:00
  • closed this issue
  • removed the
    quickfix
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/easystitch#69
No description provided.