Quartz.Extensions.Redis 3.18.1

Prefix Reserved
dotnet add package Quartz.Extensions.Redis --version 3.18.1
                    
NuGet\Install-Package Quartz.Extensions.Redis -Version 3.18.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Quartz.Extensions.Redis" Version="3.18.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Quartz.Extensions.Redis" Version="3.18.1" />
                    
Directory.Packages.props
<PackageReference Include="Quartz.Extensions.Redis" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Quartz.Extensions.Redis --version 3.18.1
                    
#r "nuget: Quartz.Extensions.Redis, 3.18.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Quartz.Extensions.Redis@3.18.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Quartz.Extensions.Redis&version=3.18.1
                    
Install as a Cake Addin
#tool nuget:?package=Quartz.Extensions.Redis&version=3.18.1
                    
Install as a Cake Tool

title: Redis Lock Handler

Quartz.Extensions.Redis provides a Redis-based distributed lock handler (ISemaphore) that replaces database row locks in clustered Quartz.NET setups.

::: tip Useful when database row locks (the default for clustered setups) cause deadlocks or performance issues under heavy scheduling load. :::

::: tip Quartz 3.18 or later required. :::

Installation

Install-Package Quartz.Extensions.Redis

Why Redis Locks?

The default StdRowLockSemaphore uses SELECT ... FOR UPDATE database row locks to coordinate trigger acquisition across cluster nodes. Under heavy scheduling load this can lead to:

  • Table deadlocks in certain database engines
  • Connection timeouts when obtaining locks is slow
  • Performance degradation from lock contention on the QRTZ_LOCKS table

The Redis lock handler replaces these database locks with Redis SET NX PX distributed locks while keeping all job and trigger data in your relational database.

Configuring

var schedulerFactory = SchedulerBuilder.Create()
    .UsePersistentStore(store =>
    {
        store.UseSqlServer(connectionString);
        store.UseSystemTextJsonSerializer();
        store.UseClustering();
        store.UseRedisLockHandler(redis =>
        {
            redis.RedisConfiguration = "redis-server:6379";
        });
    })
    .Build();

Using properties

var properties = new NameValueCollection
{
    ["quartz.jobStore.type"] = "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz",
    ["quartz.jobStore.clustered"] = "true",
    ["quartz.jobStore.lockHandler.type"] = "Quartz.Impl.Redis.RedisSemaphore, Quartz.Extensions.Redis",
    ["quartz.jobStore.lockHandler.redisConfiguration"] = "redis-server:6379"
};

Configuration Properties

Property Default Description
redisConfiguration localhost:6379 StackExchange.Redis connection string
keyPrefix quartz:lock: Prefix for Redis lock keys
lockTtlMilliseconds 30000 Lock TTL in milliseconds (auto-expires after this duration)
lockRetryIntervalMilliseconds 100 Polling interval between SET NX retry attempts

All properties are set under quartz.jobStore.lockHandler.*. The schedName and tablePrefix properties are injected automatically.

How It Works

The lock handler uses a two-tier locking strategy:

  1. Local tier — A SemaphoreSlim per lock name prevents redundant Redis round-trips when the same process already holds the lock.

  2. Redis tierSET key value NX PX timeout provides the cross-node distributed lock. The key includes the scheduler name for multi-scheduler isolation (e.g., quartz:lock:MyScheduler:TRIGGER_ACCESS).

Lock release uses a Lua script for atomic check-and-delete, preventing a node from accidentally releasing a lock that has already expired and been re-acquired by another node.

Considerations

  • Lock TTL: The default 30-second TTL provides ample margin for typical scheduling operations (milliseconds to low seconds). If your database is very slow, increase the TTL. If a node crashes, the lock auto-expires after the TTL.
  • Redis availability: If Redis is unreachable, ObtainLock throws a LockException which the scheduler handles via its standard retry mechanism.
  • Single-instance Redis: This implementation uses simple SET NX locks, not the Redlock algorithm. For most Quartz.NET deployments a single Redis instance (or replica set with Sentinel) is sufficient since the locks are advisory and short-lived.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.18.1 199 4/25/2026
3.18.0 80 4/25/2026