# Parameter "runtime\_hours"

**URL:** <https://discourse.openiap.io/t/parameter-runtime-hours/1182>\
**Category:** OpenCore\
**Tags:** agent\
**Created:** [February 20, 2024, 9:54am UTC](https://discourse.openiap.io/t/parameter-runtime-hours/1182 "2024-02-20T09:54:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Velinkton](https://discourse.openiap.io/user_avatar/discourse.openiap.io/velinkton/32/931_2.png) [@Velinkton](https://discourse.openiap.io/u/Velinkton)\
**Post date:** [February 20, 2024, 9:54am UTC](https://discourse.openiap.io/t/parameter-runtime-hours/1182/1 "2024-02-20T09:54:35Z")

</div>

I had a question for one of my previous topics. I created a resource with agent plans. As Allan said, you need to choose any non-free plan to keep agents active. I did this, but they still turned off, but only after 24 hours, and not after 8. Having gone into the resource settings, I noticed the parameter runtime\_hours, the value of which is 24.

The question is: how can I remove this limit? Do you need to remove a parameter or give it some special value?

 ![image](https://discourse.openiap.io/uploads/default/original/2X/a/a708d8fec75c29bfe55c8d6128c989dbafbfe55e.png)

> [@Disabling agents](https://discourse.openiap.io/t/disabling-agents/1166):
>
> I encountered a problem that my NodeRED agents began to disconnect, going into the “missing” status. This began to happen recently when the number of agents increased from 3 to 8 in one day. I couldn’t track how long they work, but it feels like they work for 1-2 days and then turn off At first I thought that the Linux server did not have enough resources. I added RAM and allocated 2 cores for the processor, but the situation has not changed What could be causing this problem?

---

<div class="post-metadata">

**Author:** ![Allan\_Zimmermann](https://discourse.openiap.io/user_avatar/discourse.openiap.io/allan_zimmermann/32/12_2.png) [@Allan\_Zimmermann](https://discourse.openiap.io/u/Allan_Zimmermann)\
**Post date:** [February 20, 2024, 10:56am UTC](https://discourse.openiap.io/t/parameter-runtime-hours/1182/2 "2024-02-20T10:56:39Z")

</div>

This is how it was suppose to work.  
I fear i might have made a mistake somewhere, since everyone keeps asking (?).

- openflow with `multi_tenant` not set or set to false
  - if no agent resource is found, no agents are turned off.
  - if the agent resource has been added, agents with the free plan, will be turned off after 8 hours, all others will not.

- openflow with `multi_tenant` set to true
  - if no agent resource is found, all agents are turned off after 8 hours.
  - if the agent resource has been added, agents with the free plan, will be turned off after 8 hours, all others will not.

It seems some people are experiencing agents are getting turned off, even when multi\_tenant has not been turned on, but I’m really not sure about that ?  
Either way, it’s always easier to tell people to simply add the resource and assign a non free plan.

---

<div class="post-metadata">

**Author:** ![Allan\_Zimmermann](https://discourse.openiap.io/user_avatar/discourse.openiap.io/allan_zimmermann/32/12_2.png) [@Allan\_Zimmermann](https://discourse.openiap.io/u/Allan_Zimmermann)\
**Post date:** [February 20, 2024, 1:47pm UTC](https://discourse.openiap.io/t/parameter-runtime-hours/1182/3 "2024-02-20T13:47:24Z")

</div>

i just re-read your post.  
Did I understand your question as, if you remove `runtime_hours` if that then disable the “turn off agents” thing ?  
Not, not right now, then it defaults to 8 hours, but i guess that would make sense to make it work that way instead …

---

<div class="post-metadata">

**Author:** ![Velinkton](https://discourse.openiap.io/user_avatar/discourse.openiap.io/velinkton/32/931_2.png) [@Velinkton](https://discourse.openiap.io/u/Velinkton)\
**Post date:** [February 22, 2024, 12:45pm UTC](https://discourse.openiap.io/t/parameter-runtime-hours/1182/4 "2024-02-22T12:45:16Z")

</div>

As I expected, by deleting the resource and returning all agents to the free plan, the problem was resolved - even after 24 hours, my agents remained active. I think this happened because I do not have the multi-tenancy feature enabled (my OpenFlow is deployed locally).

But in any case, I think it’s worth looking at the correctness of this functionality, because it works a little differently than you describe

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openiap.io/uploads/default/original/2X/a/a1ca7b164ac9a826839704d9ac82c7b5e6bcf557.png) [@system](https://discourse.openiap.io/u/system)\
**Post date:** [February 25, 2024, 12:45pm UTC](https://discourse.openiap.io/t/parameter-runtime-hours/1182/5 "2024-02-25T12:45:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Allan\_Zimmermann](https://discourse.openiap.io/user_avatar/discourse.openiap.io/allan_zimmermann/32/12_2.png) [@Allan\_Zimmermann](https://discourse.openiap.io/u/Allan_Zimmermann)\
**Post date:** [February 26, 2024, 12:50pm UTC](https://discourse.openiap.io/t/parameter-runtime-hours/1182/6 "2024-02-26T12:50:25Z")

</div>

The system was really broken.  
I will push an update that streamlines it, and makes it easier to understand

> [@Node-Red Constantly Disabling on VPS: Seeking Solutions for Continuous Operation](https://discourse.openiap.io/t/node-red-constantly-disabling-on-vps-seeking-solutions-for-continuous-operation/1178/8):
>
> both docker and kubernetes had he exact same code const resource = await Config.db.GetResource("Agent Instance", parent); let runtime: number = resource?.defaultmetadata?.runtime\_hours; if (NoderedUtil.IsNullUndefinded(runtime)) { // If agent resource does not exists, dont turn off agents runtime = 0; // If agent resource does exists, but have no default, use 24 hours if (!NoderedUtil.IsNullUndefinded(resource)) runtime = 2…
