# Automatic Throttle

**URL:** <https://discourse.nodered.org/t/automatic-throttle/98786>\
**Category:** Feature Requests\
**Tags:** flowfuse\
**Created:** [22 August 2025 14:05 UTC](https://discourse.nodered.org/t/automatic-throttle/98786 "2025-08-22T14:05:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AllanOricil](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allanoricil/32/106911_2.png) [@AllanOricil](https://discourse.nodered.org/u/AllanOricil)\
**Post date:** [22 August 2025 14:05 UTC](https://discourse.nodered.org/t/automatic-throttle/98786/1 "2025-08-22T14:05:51Z")

</div>

When enabled, node-red would throttle its runtime based on memory allocation instead of exiting the whole process.

```js
throttling : {
    max_memory: process.env.NR_THROTTLING_MAX_MEMORY;
   db_url: process.env.NR_THROTTLING_DB_URL;
}

```

There would exist a global queue controlling the runtime and messaging processing based on the reported amount of memory by the memory manager. Before stacking the call of a node, the manager would have to be consulted if there is enough memory in the allocated heap for the node process. The global queue has to store messages in a configurable db.

When HA is available, like in Flowfuse, a new metric called "throttling\_queue\_length" could be used by the load balancer to determine which container it has to send requests to. It would prefer sending requests to containers with undefined throttlin\_queue\_lenght or the one with the smallest value of throttling\_queue\_length instead of using round robin

**Current Workarounds:**

In order to avoid infinite container restarts

- increase container memory to be bigger than the empirical defined amount of memory my flow uses
- use a plugin that turns off the flow when memory reaches a certain threshold
- create flows with memory cap in mind. This takes extra effort from devs. There are many strategies like threating flows as transactions and never allow "parrallel" processing within the same flow. This isn't enought though. I once had to add timers to give time for the garbage collector to release memory before picking the starting the next transaction.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [22 August 2025 15:00 UTC](https://discourse.nodered.org/t/automatic-throttle/98786/2 "2025-08-22T15:00:55Z")

</div>

> [@AllanOricil](#):
>
> ```auto
> throtling : {
> max_memory: process.env.NR_THROTLING_MAX_MEMORY;
> }
> 
> ```

Should that be;

Throttling, and not throtling 😉

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [25 August 2025 22:31 UTC](https://discourse.nodered.org/t/automatic-throttle/98786/4 "2025-08-25T22:31:58Z")

</div>

This sounds more like a node.js issue as the v8 engine has the responsibility for memory management and garbage collection etc.

---

<div class="post-metadata">

**Author:** ![AllanOricil](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allanoricil/32/106911_2.png) [@AllanOricil](https://discourse.nodered.org/u/AllanOricil)\
**Post date:** [26 August 2025 12:11 UTC](https://discourse.nodered.org/t/automatic-throttle/98786/5 "2025-08-26T12:11:18Z")

</div>

My issue happens when running node-red in flowforge. My container keeps restarting indefinitely when I do somethimg wrong in my flow, like adding a node that fills it the whole heap. The "safe-mode" doesn't start and as a user I can't fix my flow.

If there was a button in Flowforge to "put container in safe-mode", I would be able to fix my problem as a user.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 November 2025 12:12 UTC](https://discourse.nodered.org/t/automatic-throttle/98786/6 "2025-11-24T12:12:07Z")

</div>

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