|
@@ -45,6 +45,24 @@ struct Config {
|
|
|
/// honoured and clamped to the retained count, because rows beyond it were
|
|
/// honoured and clamped to the retained count, because rows beyond it were
|
|
|
/// trimmed on write and do not exist to return. Raising THIS is the remedy;
|
|
/// trimmed on write and do not exist to return. Raising THIS is the remedy;
|
|
|
/// there was never anything to fix in the handler.
|
|
/// there was never anything to fix in the handler.
|
|
|
|
|
+ ///
|
|
|
|
|
+ /// THE COST THIS RAISES IS NOT THE BYTES, AND IT IS STATED HERE BECAUSE IT
|
|
|
|
|
+ /// WAS REASONED ABOUT RATHER THAN MEASURED. `trimOldest` runs on EVERY
|
|
|
|
|
+ /// append with `offset = keep` over a `function_id` filter and a sort on
|
|
|
|
|
+ /// `started_at`, and **no index is declared on `function_id`** - so each
|
|
|
|
|
+ /// append scans the project's whole run log, sorts the matching rows and
|
|
|
|
|
+ /// skips `keep` of them. Tenfold `keep` is therefore roughly tenfold rows
|
|
|
|
|
+ /// held (~900 to ~9000 for 18 functions) and a correspondingly larger scan
|
|
|
|
|
+ /// per run, on a box with ONE vCPU where one tenant's load already degrades
|
|
|
|
|
+ /// every other tenant proportionally.
|
|
|
|
|
+ ///
|
|
|
|
|
+ /// The arithmetic says this is small - a few ms against a pure DB read
|
|
|
|
|
+ /// measured at 8-35 ms, and at most once a minute per cron function - but
|
|
|
|
|
+ /// that is an estimate and this file is full of warnings about exactly this
|
|
|
|
|
+ /// shape, so: it has not been measured, and the measurement to take is the
|
|
|
|
|
+ /// append latency of a run on a project whose log holds the new ceiling.
|
|
|
|
|
+ /// The structural fix is an index on `function_id`, which would make the
|
|
|
|
|
+ /// trim cost track the matching rows instead of the collection.
|
|
|
uint32_t functionRunsKept = 500;
|
|
uint32_t functionRunsKept = 500;
|
|
|
/// Shared secret presented to the runners. Prefer SVAPI_RUNNER_TOKEN in
|
|
/// Shared secret presented to the runners. Prefer SVAPI_RUNNER_TOKEN in
|
|
|
/// vectorapi.env over config.json, which is a conffile and tends to be
|
|
/// vectorapi.env over config.json, which is a conffile and tends to be
|