Skip to content

DurableJobsOptions Properties

Configuration options for the durable jobs feature.

JobStatusPollInterval

getset
View source
public TimeSpan JobStatusPollInterval
Gets or sets the delay before polling an asynchronous durable job handler again. The job continues holding its concurrency slot while it is polled. Default: 1 second.

MaxAdoptedCount

getset
View source
public int MaxAdoptedCount
Gets or sets the maximum number of times a shard can be adopted from a dead owner before being marked as poisoned. A shard that repeatedly causes silos to crash will exceed this threshold as it bounces between owners. When the next adoption would cause the adopted count to exceed this value, the shard is considered poisoned and will no longer be assigned to any silo. Default: 3.

MaxConcurrentJobsPerSilo

getset
View source
public int MaxConcurrentJobsPerSilo
Gets or sets the maximum number of jobs that can be executed concurrently on a single silo. Default: 10,000 × processor count.

OverloadBackoffDelay

getset
View source
public TimeSpan OverloadBackoffDelay
Gets or sets the delay between overload checks when the host is overloaded. Job batch processing will pause for this duration before rechecking the overload status. Default: 5 second.

ShardActivationBufferPeriod

getset
View source
public TimeSpan ShardActivationBufferPeriod
Gets or sets how far in advance (before the shard's start time) the shard should begin processing. This prevents holding idle shards for extended periods. Default: 5 minutes.

ShardBatchLingerDelay

getset
View source
public TimeSpan ShardBatchLingerDelay
Gets or sets the maximum amount of time the shard operation processor will wait for additional mutations to join an in-flight batch after the first one arrives.

ShardClaimInitialBudget

getset
View source
public int ShardClaimInitialBudget
Gets or sets the maximum number of orphaned shards a silo may claim immediately after startup. The cumulative budget grows linearly from this value to DurableJobsOptions over DurableJobsOptions, after which the limit is removed entirely. This prevents a freshly started silo from overwhelming itself by claiming all orphaned shards at once during disaster-recovery scenarios. Default: 2.

Examples

options.ShardClaimInitialBudget = 1;

ShardClaimMaxBudget

getset
View source
public int ShardClaimMaxBudget
Gets or sets the total number of orphaned shards the silo is allowed to have claimed by the end of the shard-claim ramp-up period. The cumulative budget is linearly interpolated between DurableJobsOptions at startup and this value at DurableJobsOptions. Default: 20.

Examples

options.ShardClaimMaxBudget = 50;

ShardClaimRampUpDuration

getset
View source
public TimeSpan ShardClaimRampUpDuration
Gets or sets the duration of the shard-claim ramp-up period after silo activation. While the silo has been running for less than this duration, the number of orphaned shards it may claim is limited by a linearly increasing budget. Once this period elapses the silo claims all available orphaned shards without limit. Set to System.TimeSpan.Zero to disable shard-claim ramp-up entirely. Default: 5 minutes.

Examples

options.ShardClaimRampUpDuration = TimeSpan.FromMinutes(10);

ShardDuration

getset
View source
public TimeSpan ShardDuration
Gets or sets the duration of each job shard. Smaller values reduce latency but increase overhead. For optimal alignment with hour boundaries, choose durations that evenly divide 60 minutes (e.g., 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, or 60 minutes) to avoid bucket drift across hours. Default: 1 hour.

ShardStripeCount

getset
View source
public int ShardStripeCount
Gets or sets the number of writable shards to use for each shard time bucket. Increasing this value distributes jobs with the same due-time bucket across multiple shard journals. Default: 1.

ShouldRetry

getset
View source
public Func<IJobRunContext, Exception, DateTimeOffset?> ShouldRetry
Gets or sets the function that determines whether a failed job should be retried and when. The function receives the job context and the exception that caused the failure, and returns the time when the job should be retried, or null if the job should not be retried. Default: Retry up to 5 times with exponential backoff (2^n seconds).

SlowStartInitialConcurrency

getset
View source
public int SlowStartInitialConcurrency
Gets or sets the initial number of concurrent jobs allowed per silo when slow start is enabled. Concurrency will exponentially increase from this value until DurableJobsOptions is reached. Default: System.Environment.ProcessorCount.

SlowStartInterval

getset
View source
public TimeSpan SlowStartInterval
Gets or sets the interval at which concurrency is doubled during slow start ramp-up. Default: 10 seconds.