Hangfire with Sql storage shows zero active servers and stops processing jobs on AWS EC2 instance


#1

Hello,
I used hangfire for several years running in local data center and everything worked fine.
I moved application to AWS EC2 instance , but database remained in local data center.
So, application on EC2 is very unstable , sometimes runs for days , but sometimes after running for an hour or so stops showing heart beat.
If I run the same app on local server by shut-downing one on ec2, it just works fine…

Btw, we run multiple hangfire databases on one sql server each application owns it is own hangfire database. Is this a good practice.
Ec2 instance is Windows 2016
While local server Windows 2012 R2.
Same .net version 4.7.2

I use latest version of hangfire 1.7.4

Here is how I configure it
GlobalConfiguration.Configuration.UseSqlServerStorage((ApNgSettings.Instance.HangfireSqlserverConnectionString),
new SqlServerStorageOptions {
CommandBatchMaxTimeout = TimeSpan.FromMinutes(5),
SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5),
QueuePollInterval = TimeSpan.Zero,
UseRecommendedIsolationLevel = true,
DisableGlobalLocks = true
});

Regards,
Zilvinas


#2

I am running app as a standalone console based app, and also run dashboard as separate server.
I noticed if i restart dashboard app , it shows 1 server again, but server still does not process jobs.