Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LastHeartbeat SQL Issue #16

Open
YodasMyDad opened this issue Nov 14, 2019 · 1 comment
Open

LastHeartbeat SQL Issue #16

YodasMyDad opened this issue Nov 14, 2019 · 1 comment

Comments

@YodasMyDad
Copy link

I apologise if I'm not understanding this add on correctly, but I thought adding this would move the polling/heartbeat away from SQL and into AzureServiceBus.

However, I have this running on my site and noticed I've been getting a SQL time out error every now and then which is attributed to "update [HangFire].Server set LastHeartbeat = @now where Id = @id". I can see Hangfire smashing the SQL db every second?

I was under the impression that this removed the need for the constant SQL heartbeat?

@odinserj
Copy link
Member

odinserj commented Nov 15, 2019

You can control the heartbeat rates by using HeartbeatInterval and ServerTimeout properties in the BackgroundJobServerOptions class you can inject when creating a background job server. Ensure that multiple (at least) heartbeats are sent within the ServerTimeout timespan.

They are still required, because background job server will restart itself if heartbeat wasn't succeeded because the record from the Server table was removed. And since we need to somehow remove obsolete records even in case of unexpected termination, we need some sort of timeouts here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants