HangfireIO / HangfireIO/Hangfire
Millions/Billions of HangFire queries being highlight in SSMS Activity Monitor
- Dominant language
- C#
- Stars
- 10.1k
- Forks
- 1.8k
- Avg merge
- 1h 19m
- Merged PRs (30d)
- 1
Description
Hi, I'm trying to get to the bottom of some performance issues on our production environment and SSMS is highlighting the following query in the activity monitor under expensive queries:
```
```

We are using the following settings, which are implied by [similar](https://github.com/HangfireIO/Hangfire/issues/1962) [issues](https://github.com/HangfireIO/Hangfire/issues/1664) already:
```
GlobalConfiguration.Configuration.UseSqlServerStorage(Globals.ConnectionString, new SqlServerStorageOptions
{
SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5),
QueuePollInterval = TimeSpan.Zero
});
```
The query count seems to deviate between about 23,000 and >1.2 billion (as per the above screenshot). Why is this and have I misconfigured something? Here's a screenshot of all our recurring jobs (we only use HangFire for these recurring jobs):

Contributor guide
Research direction
Start with the reported JobQueue UPDATE query and the SqlServerStorageOptions settings, then compare the behavior with similar issues 1962 and 1664. Investigate why SSMS reports query counts ranging from 23,000 to over 1.2 billion for recurring jobs. Done means explaining whether the count is expected or identifying a configuration or implementation problem.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100