danyolgiax
danyolgiax

Reputation: 13086

IIS Worker Process busy using Hangfire

I'm using Hangfire in my MVC webapp. I configured it this way:

GlobalConfiguration.Configuration
         .UseMongoStorage(mongoConnectionString, mongoDatabaseName);

app.UseHangfireServer();

When I run the application I see IIS Worker Process takes constantly almost 40% CPU.

Removing it brings the application to works normally.

What's wrong?

Upvotes: 0

Views: 477

Answers (1)

odinserj
odinserj

Reputation: 964

Hangfire.Mongo since version 0.2.2 uses a new version of the mongocsharpdriver package that migrated to async API when talking with Mongo. Hangfire still uses synchronous methods, and looks like there is an error in "sync over async" wrapper.

One user reported that after setting the following options everything is fine.

CountersAggregateInterval = TimeSpan.FromMinutes(5);
JobExpirationCheckInterval = TimeSpan.FromHours(1);

However, the fix isn't available currently, and another option is to downgrade the Hangfire.Mongo package to the previous version. Please see the related GitHub issue.

Upvotes: 1

Related Questions