ecluse
Safe HaskellNone
LanguageGHC2021

Ecluse.Composition.Sizing

Description

Resolve metadata concurrency, connection pools and mirror-enqueue bounds with boot-log provenance. Ecluse.Composition.MemoryPlan owns byte-valued bounds. Explicit configuration takes precedence.

Synopsis

A resolved bound and its boot-log line

resolveSized :: Show a => Text -> Maybe a -> a -> Text -> (a, Text) Source #

A resolved bound and its boot-log line: an explicit config value wins, else the computed default. Every sizing and every memory-plan bound resolves through this.

renderSized :: Show a => Text -> a -> Maybe a -> Text -> Text Source #

The boot-log line for a bound already resolved elsewhere. The explicit config value decides the provenance clause, and the caller supplies the computed alternative.

Connection pools and admission

newPooledManager :: Int -> ManagerSettings -> IO Manager Source #

Open an HTTP manager under an explicit per-host connection bound. Every manager the composition root builds comes from here, so one pool bound applies whatever dials through it.

connectionPoolSettings :: Int -> ManagerSettings -> ManagerSettings Source #

Apply an explicit per-host connection bound to an HTTP manager's settings. Callers apply it after telemetry instrumentation, so it cannot discard the instrumented hooks.

resolveServeAdmission :: Maybe Int -> Int -> (Int, Text) Source #

Resolve metadata concurrency independently of its byte budget. An explicit capacity stays exact.

resolvePrivateConnections :: Maybe Int -> Int -> (Int, Text) Source #

The private pool size and its boot-log line: privateConnectionsPerHost, else clamp (64, 4096) (nofile / 4). managerConnCount caps retention, not concurrency.

resolvePublicConnections :: Maybe Int -> Int -> (Int, Text) Source #

The public pool size and its boot-log line: publicConnectionsPerHost, else clamp (32, 1024) (nofile / 8). Onboarding fail-over and back-fill streams ride it too.

openFileSoftLimit :: IO Int Source #

The process soft file-descriptor limit (RLIMIT_NOFILE). An infinite or unknown limit falls back to a value that lands the computed pool on its cap rather than overflowing.

Mirror-enqueue buffering

mirrorEnqueueBufferDepth :: Int Source #

The depth of the hand-off buffer in front of the mirror queue. It absorbs a cold npm ci burst, and a job dropped at the cap re-enqueues on the next demand, so overflow defers a mirror.

mirrorEnqueueReportInterval :: Int Source #

How many enqueue-buffer drops or delivery failures pass between warning-log reports. The buffer's callbacks still fire per event, so the counter beside the log stays exact.