How are threads configurations applied in streams mode? #2445
Replies: 1 comment 1 reply
-
Hey @ryanpodonnell1 👋
Test each individual stream to see what is its max memory usage can be and then reserve enough memory for Benthos to accommodate the sum of the max memory usage of each stream, because, worst case, you may have all the streams reach their peak memory consumption simultaneously. For memory intensive workloads, it may be easier to stick with one pipeline per Benthos instance instead of running it in Streams Mode.
I think it's good practice to set that variable in production like you did, but if your streams need to allocate more memory than what's available, you'll get an OOM.
The
Possibly. Benthos processes are cheap. Also, note that you can also use the Maybe start by setting |
Beta Was this translation helpful? Give feedback.
-
We're currently piloting benthos and keep getting OOM'd on ECS tasks with 8GB memory per container (1-2 containers per host at 8 vcpus).
We are currently using the following processors (just listing them not a config file)
Is there a best practice around using streams mode?
Were really only using streams mode to have it load multiple config files (right now were at about 5 config files or so with 1input/1output) and not leveraging the API at this point. I'm thinking its prob better to have a dedicated container per SQS queue? Any suggestions to pinpoint culprits or debug the issue?
we've applied
GOMEMLIMIT
as an env var to about 250MB less than the hard limit of the container and that has limited some of the bleeding but still getting random crashesmy current theory is that its attempting to load everything and not "balancing" the thread count across all the streams (i.e. each stream is using -1 as its value and defaulting to the cpu count to the task for ALL of the streams) instead of using a shared pool. Could be totally wrong on this though without any proof to back it up
Beta Was this translation helpful? Give feedback.
All reactions