# Hangfire keeps stopping randomly

**URL:** https://discuss.hangfire.io/t/hangfire-keeps-stopping-randomly/11397
**Category:** bug?
**Created:** [November 11, 2025, 5:38pm UTC](https://discuss.hangfire.io/t/hangfire-keeps-stopping-randomly/11397 "2025-11-11T17:38:39Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ajisha](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/ajisha/32/4049_2.png) [@Ajisha](https://discuss.hangfire.io/u/Ajisha)
#### Post date: [November 11, 2025, 5:38pm UTC](https://discuss.hangfire.io/t/hangfire-keeps-stopping-randomly/11397/1 "2025-11-11T17:38:39Z")

</div>

Hangfire api keeps stopping randomly how do I prevent this. I have provided all the app settings with no idle timeout and startmode. Is there a way to resolve this ?

---

<div class="post-metadata">

### Author: ![Tieson\_Trowbridge](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/tieson_trowbridge/32/2895_2.png) [@Tieson\_Trowbridge](https://discuss.hangfire.io/u/Tieson_Trowbridge)
#### Post date: [November 14, 2025, 10:13am UTC](https://discuss.hangfire.io/t/hangfire-keeps-stopping-randomly/11397/2 "2025-11-14T10:13:09Z")

</div>

Hard to say, lacking context.

If you’re using an [ASP.NET](http://ASP.NET) site as your Hangfire host, and it’s hosted in IIS, then no matter how you figure HF or the site, IIS will suspend the site at some point, from lack of activity.

---

<div class="post-metadata">

### Author: ![Ajisha](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/ajisha/32/4049_2.png) [@Ajisha](https://discuss.hangfire.io/u/Ajisha)
#### Post date: [November 14, 2025, 3:28pm UTC](https://discuss.hangfire.io/t/hangfire-keeps-stopping-randomly/11397/3 "2025-11-14T15:28:24Z")

</div>

Hi

It stopped randomly at 3 am sometimes at 2 am and then 7 pm.

Do you know how I can resolve this ?

---

<div class="post-metadata">

### Author: ![Tieson\_Trowbridge](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/tieson_trowbridge/32/2895_2.png) [@Tieson\_Trowbridge](https://discuss.hangfire.io/u/Tieson_Trowbridge)
#### Post date: [November 14, 2025, 5:48pm UTC](https://discuss.hangfire.io/t/hangfire-keeps-stopping-randomly/11397/4 "2025-11-14T17:48:40Z")

</div>

If you’re hosting it inside an [ASP.NET](http://ASP.NET) site, then you need to implement some sort of “keep alive” process. Basically, you need something to ping the site on a predetermined interval. That will keep IIS from stopping the site.

You can do this as a CRON (recurring) job.

If you’re _not_ hosting the background client in [ASP.NET](http://ASP.NET), then you need to provide more details.

---

<div class="post-metadata">

### Author: ![alpasen](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@alpasen](https://discuss.hangfire.io/u/alpasen)
#### Post date: [November 18, 2025, 7:36pm UTC](https://discuss.hangfire.io/t/hangfire-keeps-stopping-randomly/11397/5 "2025-11-18T19:36:48Z")

</div>

I agree. It sounds like and IIS issue. By default, IIS will recycle the app pool every 29 hours. While it “restarts”, it doesn’t really restart until a request comes to IIS. There are setting you can adjust in IIS to get it to fully restart and to control when it does that restart if you want to allow that.

This link is a big help.

> **[Making ASP.NET Application Always Running — Hangfire Documentation](https://docs.hangfire.io/en/latest/deployment-to-production/making-aspnet-app-always-running.html)**
