My application creates a connection flow. The application is eninng under a non-zero user ID, and sometimes the number of threads exceeds the default value of 1024. I want to edit this number, so I have several options
run as root [a very bad idea, as well as a compromise with securty, so discarding it)
run using setcap as an invalid user and enable CAP_SYS_RESOURCE . then I can add code to my program
struct rlimit rlp;
setrlimit(RLIMIT_NPROC, &rlp);
Another thing is to edit /etc/securitylimits.conf, where I can just make an entry for the development user and put the lines, for example.
@devuser hard nproc 20000
@devuser soft nproc 10000
10k . chaning, . , .
, :)
PS: , 1k . ofcource 32 Ram