Job Throttling
Chronicle Server’s job system can be configured to limit the number of parallel job steps to prevent excessive CPU usage.
Configuration
Section titled “Configuration”The maximum number of parallel job steps can be configured using the MaxParallelSteps option in chronicle.json:
{ "Jobs": { "MaxParallelSteps": 4 }}| Property | Type | Default | Description |
|---|---|---|---|
| MaxParallelSteps | number | Environment.ProcessorCount - 1 | Maximum number of parallel job steps (minimum 1) |
The limit that applies is the smaller of Jobs:MaxParallelSteps and Observers:MaxConcurrentPartitions (default 32, see Observers). With the defaults, Jobs:MaxParallelSteps only has an effect below 32, so raising it above 32 needs Observers:MaxConcurrentPartitions raised as well.
Alternatively, you can use environment variables:
Cratis__Chronicle__Jobs__MaxParallelSteps=4Default Behavior
Section titled “Default Behavior”If MaxParallelSteps is not configured, Chronicle uses a sensible default:
- Default value:
Environment.ProcessorCount - 1 - Minimum value:
1(even on single-core systems)
For example, on an 8-core system, the default would be 7 parallel steps.
How It Works
Section titled “How It Works”- Each job step attempts to acquire a slot before executing.
- If all slots are in use, the step waits in a queue.
- When a step completes (successfully or with an error), it releases its slot.
- The next waiting step can then acquire the released slot.
This ensures that the job system never uses more than the configured number of CPU cores simultaneously.
Use Cases
Section titled “Use Cases”High-throughput systems: Limit parallel steps to leave CPU resources for other operations:
{ "Jobs": { "MaxParallelSteps": 2 }}Dedicated job processing: Use more CPU cores for job processing:
{ "Jobs": { "MaxParallelSteps": 16 }}Testing environments: Reduce resource usage:
{ "Jobs": { "MaxParallelSteps": 1 }}