Tag Info

Hot answers tagged

4

There is no such tool because it does not make any sense from a single-program point of view. One can consider CPU/HDD/RAM/swap as resources. These resources can be shared in different ways by the operating system among processes, users, contexts, etc. In some specific situations, it makes sense to tell the operating system to enforce hard limits: Don't ...


2

There is something kind of what you describe: there is a feature to limit the amount of RAM used by a process (RAM, as opposed to virtual memory). The RLIMIT_RSS limit sets an upper bound a program's resident set size, i.e. the part of the memory of that process which is resident in memory (as opposed to swapped out). However, it is not implemented on Linux. ...


2

While I don't know of a way to limit the number of processes by name, you may be able to accomplish your overall goal via pam_limits by limiting the number of user logins. An entry in /etc/security/limits such as @remotes hard maxlogins 5 will ensure that the users of the remotes group cannot have more than 5 login sessions on the ...


2

All values is correct and have different meanings./proc/sys/kernel/pid_max is maximum value for PID, ulimit -u is maximum value for number of processes. From man 5 proc: /proc/sys/kernel/pid_max (since Linux 2.5.34) This file specifies the value at which PIDs wrap around (i.e., the value in this file is one greater than the ...


1

There is almost certainly a better way of doing this, probably through limits.conf but I don't know it so here's a dirty hack. This command will kill all processes owned by the user terdon that are using more than 3G of RAM: ps -u terdon -o vsize= -o pid= | while read mem pid; do [ $mem -gt 3145728 ] && kill $pid; done The ps -u terdon -o ...



Only top voted, non community-wiki answers of a minimum length are eligible