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.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!