spec: single-process-single-worker#664
Open
filafb wants to merge 1 commit into
Open
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds an SDD specification (
specs/single-process-single-worker.md, Status: Draft) proposing single-process mode for@vtex/api: when the resolved worker count is1, the SDK runs the HTTP server directly in the main process and skips Node'sclusterlayer entirely — no master, nofork(), no IPC connection forwarding.@vtex/apiis injected into all VTEX IO applications, so today's unconditional "master + at least one worker" topology multiplies a fixed per-replica cost (an idle master process + IPC accept/distribute hop) across the whole platform whenever a service runs a single worker. This spec eliminates that for the single-worker case while leaving multi-worker (workers > 1) behavior unchanged.Decisions captured
serviceJSON.workers === 1;getWorkers/default worker count untouched.LINKED/dev mode too — debugger attaches to the main process (replacingcluster.setupMasterinspect-port indirection).Spec contents
SO_REUSEPORTredesign are deferred).minReplicas ≥ 2is the default topology).ServiceJSON.workersas the decision input (no schema change), reused interfaces, integration points, invariants.Out of scope
No implementation — this PR contains the spec file only. Changing the default worker count (cgroup-aware) and replacing
clusterwithSO_REUSEPORTare deferred to separate specs.🤖 Generated with Claude Code