# Heartbeat not running all monitors when scheduler limit is set

**URL:** https://discuss.elastic.co/t/heartbeat-not-running-all-monitors-when-scheduler-limit-is-set/207792
**Category:** Beats
**Tags:** heartbeat
**Created:** [November 13, 2019, 11:17pm UTC](https://discuss.elastic.co/t/heartbeat-not-running-all-monitors-when-scheduler-limit-is-set/207792 "2019-11-13T23:17:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bwright1558](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bwright1558/32/58732_2.png) [@bwright1558](https://discuss.elastic.co/u/bwright1558)
#### Post date: [November 13, 2019, 11:17pm UTC](https://discuss.elastic.co/t/heartbeat-not-running-all-monitors-when-scheduler-limit-is-set/207792/1 "2019-11-13T23:17:08Z")

</div>

I'm using Heartbeat version 7.4.2. I've got 40+ HTTP monitors configured for Heartbeat, all of which use the cron syntax for scheduling. I'm using '0 0 \*/2 \* \* \* \*', meaning every 2 hours. I also have the scheduler.limit set to 10, so only 10 tasks at a time. When the time rolls around to run the monitors, not all monitors are run. In fact, they don't run until 2 more hours later (sometimes not even then). Sometimes there will be monitors that don't run for 6+ hours.

Am I misunderstanding how the scheduler limit should work? Or is this a bug? Thoughts and suggestions please.

---

<div class="post-metadata">

### Author: ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)
#### Post date: [November 14, 2019, 2:02pm UTC](https://discuss.elastic.co/t/heartbeat-not-running-all-monitors-when-scheduler-limit-is-set/207792/2 "2019-11-14T14:02:08Z")

</div>

~~That cron config `0 0 */2 * * * *` means every 2 days at midnight. I think you want `0 */2 * * * * *` which means the first minute every 2 hours. I'd recommend using the syntax `@every 2h` instead, since it's much more straightforward to read.~~

**EDIT:** My mistake, I was reading it wrong, you are right, that is every 2 hours. I'm going to try and repro this.

That said, I'd be interested to hear what use case you have for running heartbeat so infrequently? I've been mulling whether we should put a cap on the maximum amount of time between checks (there's some potential to improve perf in ES queries if we can depend on that).

Generally people don't check more than say 5 minutes apart. The main reason is that if a check fails for a transient reason you want to see how long it took to recover. With a two hour check, it will take 2 full hours to check.

---

<div class="post-metadata">

### Author: ![bwright1558](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bwright1558/32/58732_2.png) [@bwright1558](https://discuss.elastic.co/u/bwright1558)
#### Post date: [November 14, 2019, 3:24pm UTC](https://discuss.elastic.co/t/heartbeat-not-running-all-monitors-when-scheduler-limit-is-set/207792/3 "2019-11-14T15:24:28Z")

</div>

Please don't cap the maximum amount of time between checks. At least allow every couple hours. We do have good reason for running our checks infrequently. We have kind of a unique use case and heartbeat I hope is the solution that will solve all our maintenance woes. Adding a cap of less than an hour will make heartbeat useless to us. So please don't cap it. I'll message you our specific use case.

---

<div class="post-metadata">

### Author: ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)
#### Post date: [November 18, 2019, 5:41pm UTC](https://discuss.elastic.co/t/heartbeat-not-running-all-monitors-when-scheduler-limit-is-set/207792/4 "2019-11-18T17:41:37Z")

</div>

I've opened this PR [https://github.com/elastic/beats/pull/14569](https://github.com/elastic/beats/pull/14569) which should solve the underlying issue.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [December 16, 2019, 5:41pm UTC](https://discuss.elastic.co/t/heartbeat-not-running-all-monitors-when-scheduler-limit-is-set/207792/5 "2019-12-16T17:41:43Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
