Limit the number of process threads

Hi,
yes you can set in the GUI->CT->Resources
double-click on CPU and set it.
 
No this is not supported by pve.
but you can set the pids.

see kernel docu
Documentation/cgroup-v1/pids.txt
 
From the doc

Abstract
--------

The process number controller is used to allow a cgroup hierarchy to stop any
new tasks from being fork()'d or clone()'d after a certain limit is reached.

Since it is trivial to hit the task limit without hitting any kmemcg limits in
place, PIDs are a fundamental resource. As such, PID exhaustion must be
preventable in the scope of a cgroup hierarchy by allowing resource limiting of
the number of tasks in a cgroup.
 
Or to answer your question (since I find the doc lacking): no. Threads are also created with `clone()`, so they're also covered by pids.max. So, currently you can set `lxc.cgroup.pids.max: 100` in /etc/pve/lxc/$vmid.conf manually to add a limit covering both processes and threads as a whole.