RLIMIT_CPU
Maximum CPU time the process may use.
- Resource number
- 0
- Row in /proc/PID/limits
- Max cpu time
- bash ulimit flag
- ulimit -t
- Unit in /proc/PID/limits
- seconds
- Group
- CPU time and scheduling
What happens at the limit
SIGXCPU when the soft limit is reached, then another SIGXCPU every second until the hard limit, which gets SIGKILL.
It counts CPU seconds, not wall-clock time, so a process blocked on I/O does not burn it. A handler for SIGXCPU gets a chance to flush state; the SIGKILL at the hard limit does not.
Check a running process with grep -i "Max cpu time" /proc/PID/limits, or paste the whole file into the limits reader. Inspect or change one on a live process with prlimit --pid PID(util-linux).
Sources
Resource numbers are from asm-generic/resource.h; a few architectures (Alpha, MIPS, SPARC) number some limits differently. The list of syscall cards is matched by name from the card text on this site, not from the kernel source. Spot one that's wrong? Tell Rod.