1 minute read

Tips

Data Propagation from the Previous Nodes

f-string format tips

Execution Concurrency Control

Data Pruning

Task Runner

Memory Issues

Issues

Timeout of AI Nodes

Node.js consumes 100% CPU

Debugging

$ docker stats --no-stream --no-trunc
CONTAINER ID                                                       NAME                 CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O   PIDS
9df76eab62201e9ea911b4940e8988658fa9794dadb7f103dac6cbcac4b8ed6c   beautiful_brattain   0.01%     240.5MiB / 3.755GiB   6.25%     3.46MB / 1.67MB   0B / 0B     27
71ed91ae1306bcdc0315721ea05d1c7140fd0dbfdfddd8115d40aa4e10f99981   n8n                  99.93%    507.4MiB / 3.755GiB   13.20%    166MB / 77.9MB    0B / 0B     13

$ docker exec -it n8n cat /sys/fs/cgroup/memory/memory.limit_in_bytes
9223372036854771712

$ docker exec -it n8n node --version
v20.19.0

$ docker exec -it n8n ps ux
PID   USER     TIME  COMMAND
    1 node      0:04 tini -- /docker-entrypoint.sh
    7 node      7h03 node /usr/local/bin/n8n
   53 node      0:00 ps ux

According to the Dockerfile and other referred files, n8n/docker/images/n8n/Dockerfile at master · n8n-io/n8n - https://github.com/n8n-io/n8n/blob/master/docker/images/n8n/Dockerfile

Seems like we can pass the NODE_OPTIONS environment variable.

e.g. -e NODE_OPTIONS='--max-old-space-size=1024'

Another observation:

<--- Last few GCs --->

[6:0x7165437f4690] 13489473 ms: Scavenge 2041.1 (2065.7) -> 2041.0 (2070.2) MB, 16.16 / 0.00 ms  (average mu = 0.926, current mu = 0.621) allocation failure;
[6:0x7165437f4690] 13490248 ms: Mark-Compact (reduce) 2046.5 (2074.1) -> 2045.9 (2069.1) MB, 381.25 / 0.01 ms  (+ 252.7 ms in 25 steps since start of marking, biggest step 24.5 ms, walltime since start of marking 732 ms) (average mu = 0.842, current mu =

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

DB Size Growth

Others

References

Updated: