Changing the allowed maximum number of threads

This thread includes a suggestion on how to raise the limit of threads in a Balena service container.

The suggested solution was to set DefaultTasksMax=infinity in /etc/systemd/system.conf.

I have successfully used this on a system installed with:

Linux: 5.8.18-yocto-standard, Intel NUC
BalenaOS: 2.68.1+rev1
Supervisor version: 12.3.0

However on this configuration it does not work:

Linux: 5.2.10-yocto-standard, GenericX86
BalenaOS: 2.58.6+rev1
Supervisor version: 11.14.0

Are you able to tell the requirements for the fix to work?

Hi, for reference, we have an open issue about updating the number of tasks Increase the default maximum number of tasks for balenaEngine · Issue #1844 · balena-os/meta-balena · GitHub.
We would like to find a way to increase it just for the engine and not for all the system units as the global change would do.
Also, re-mounting the filesystem and making changes to the filesystem is something we do not recommend or suggest unless it is the debug specific problems. Also, the changes will be lost when you perform a hostOS update.
Anyway, changing the global systemd configuration is device independent and should work for both the examples you provide.

Maybe you misunderstand what I have been doing to increase the max number of threads.
Our solution did not require any re-mount of the filesystem, no hostOS access and thus no changes were lost even on hostOS upgrades.

We increased the thread limit by commanding this in our main application container itself:
echo "DefaultTasksMax=12000" >> /etc/systemd/system.conf
… and so far this has worked for intelNUC as described above.
But when using the generic X86 image, this has no effect.

And my question is why?