ConcurrencySystemOptions
Index
Properties
optionalautoscaleIntervalSecs
optionalcurrentHistorySecs
How far back the task-gating decision looks, in seconds — the window used to judge whether the system is
overloaded right now, before dispatching one more task. Deliberately shorter than
snapshotHistorySecs, so that dispatch reacts to
spikes quickly while scaling stays stable.
optionaldesiredConcurrency
The desired number of tasks that should be running parallel on the start of the pool,
if there is a large enough supply of them.
By default, it is minConcurrency.
optionaldesiredConcurrencyRatio
Minimum level of desired concurrency to reach before more scaling up is allowed.
optionalloadSignals
The signals that tell the system whether the machine is overloaded: per-resource tuning for the built-in four
(memory, event loop, CPU, storage backend) plus any custom
implementations of your own. See LoadSignalsOptions.
optionallog
optionalloggingIntervalSecs
Specifies a period in which the instance logs its state, in seconds.
Set to null to disable periodic logging.
optionalmaxConcurrency
The maximum number of tasks running in parallel.
optionalmaxTasksPerMinute
The maximum number of tasks per minute the system can run.
By default, this is set to Infinity, but you can pass any positive, non-zero integer.
optionalminConcurrency
The minimum number of tasks running in parallel.
WARNING: If you set this value too high with respect to the available system memory and CPU, your code might run extremely slow or crash. If you're not sure, just keep the default value and the concurrency will scale up automatically.
optionalscaleDownStepRatio
Defines the amount of desired concurrency to be subtracted with each scaling down. The minimum scaling step is one.
optionalscaleUpStepRatio
Defines the fractional amount of desired concurrency to be added with each scaling up. The minimum scaling step is one.
optionalsnapshotHistorySecs
How far back the autoscaling decisions look, in seconds — the window the historical system status is evaluated over, and therefore how much history the signals retain (the memory cost of raising it).
Defines in seconds how often the system should attempt to adjust the desired concurrency based on the latest system status. Setting it lower than 1 might have a severe impact on performance. We suggest using a value from 5 to 20.