mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-05 07:54:38 +00:00
Limit daemon-wide Git process pressure (#2797)
* perf(server): bound Git process starts Git refresh bursts could keep creating short-lived processes at the concurrency ceiling, causing sustained process churn on constrained hosts. Apply one daemon-global start-rate and concurrency policy to every Git command while preserving the legacy concurrency environment variable. * build(nix): update npm dependency hash * fix(server): hold Git slots until process exit * fix(server): enforce Git limits across process lifetime * fix(server): align Git metrics with process exit * Fix Git limiter test deadlocks * Tune default Git process rate
This commit is contained in:
@@ -7,6 +7,7 @@ export interface GitCommandDurationStats {
|
||||
|
||||
export interface GitCommandRuntimeMetricsSnapshot {
|
||||
concurrencyLimit: number;
|
||||
maxProcessesPerSecond: number;
|
||||
active: number;
|
||||
pending: number;
|
||||
peakActive: number;
|
||||
@@ -44,7 +45,10 @@ export class GitCommandRuntimeMetricsWindow {
|
||||
private readonly operationCounts = new Map<string, number>();
|
||||
|
||||
constructor(
|
||||
private readonly concurrencyLimit: number,
|
||||
private readonly limits: {
|
||||
concurrencyLimit: number;
|
||||
maxProcessesPerSecond: number;
|
||||
},
|
||||
private readonly clock: Clock = Date.now,
|
||||
) {}
|
||||
|
||||
@@ -98,7 +102,8 @@ export class GitCommandRuntimeMetricsWindow {
|
||||
...Array.from(this.pendingCommands, (metric) => metric.queuedAtMs),
|
||||
);
|
||||
const snapshot: GitCommandRuntimeMetricsSnapshot = {
|
||||
concurrencyLimit: this.concurrencyLimit,
|
||||
concurrencyLimit: this.limits.concurrencyLimit,
|
||||
maxProcessesPerSecond: this.limits.maxProcessesPerSecond,
|
||||
active: limiter.active,
|
||||
pending: limiter.pending,
|
||||
peakActive: this.peakActive,
|
||||
|
||||
Reference in New Issue
Block a user