MongoDB storage driver not enqueueing jobs after large load

Hi there

I have ran into a problem whilst using the MongoDB driver. When i queue 250 jobs at once with a maximum number of retries of two after a few minutes, all the jobs fail to be enqueued and remain in the scheduled state.

The Hangfire.Mongo version is 0.2.1, and runs fine otherwise. From a guess it looks like the database cannot handle the large load of job states transitioning. I tried the same scenario with a Postgres database and it worked fine, so it does lead me to believe that this is a database level issue with Mongo.

Does anybody know anything around this, and possible ways to prevent it from happening.

Best

We’re experiencing almost the same with the newer Hangfire.Mongo 0.2.6:

  • We’re queuing some jobs (130) in a very short time;
  • The jobs keep in “Awaiting” state, nothing happens;
  • New jobs can be added, nothing happens;

Same scenario seems to work just fine with SqlServer (but we have to deal with a customer using Oracle here, that’s why we chose the Hangfire.Mongo scenario), and a smaller queue (28, for example) doesn’t expose this problem.

FYI, we’re now using https://www.nuget.org/packages/Hangfire.Mongo.MarLoe, in which this very problem seems to be solved (nice work https://www.nuget.org/profiles/MarLoe)