2011-10-19 15:02:35 -05:00
|
|
|
.\" prlimit.1 --
|
|
|
|
.\" Copyright 2011 Davidlohr Bueso <dave@gnu.org>
|
|
|
|
.\" May be distributed under the GNU General Public License
|
|
|
|
|
2014-07-14 04:02:58 -05:00
|
|
|
.TH PRLIMIT 1 "July 2014" "util-linux" "User Commands"
|
2011-10-19 15:02:35 -05:00
|
|
|
.SH NAME
|
2014-08-03 10:22:24 -05:00
|
|
|
prlimit \- get and set process resource limits
|
2011-10-19 15:02:35 -05:00
|
|
|
.SH SYNOPSIS
|
2014-07-14 04:02:58 -05:00
|
|
|
.BR prlimit " [options]"
|
|
|
|
.RB [ \-\-\fIresource\fR [ =\fIlimits\fR]
|
|
|
|
.RB [ \-\-pid\ \fIPID\fR]
|
2011-11-16 10:57:27 -06:00
|
|
|
|
2014-07-14 04:02:58 -05:00
|
|
|
.BR prlimit " [options]"
|
|
|
|
.RB [ \-\-\fIresource\fR [ =\fIlimits\fR]
|
|
|
|
.IR "command " [ argument ...]
|
2011-10-19 15:02:35 -05:00
|
|
|
|
|
|
|
.SH DESCRIPTION
|
2016-12-04 13:40:01 -06:00
|
|
|
Given a process ID and one or more resources, \fBprlimit\fP tries to retrieve
|
2011-10-19 15:02:35 -05:00
|
|
|
and/or modify the limits.
|
|
|
|
|
2011-11-16 10:57:27 -06:00
|
|
|
When \fIcommand\fR is given,
|
|
|
|
.B prlimit
|
|
|
|
will run this command with the given arguments.
|
|
|
|
|
2014-07-14 04:02:58 -05:00
|
|
|
The \fIlimits\fP parameter is composed of a soft and a hard value, separated
|
|
|
|
by a colon (:), in order to modify the existing values. If no \fIlimits\fR are
|
|
|
|
given, \fBprlimit\fP will display the current values. If one of the values
|
|
|
|
is not given, then the existing one will be used. To specify the unlimited or
|
2019-12-15 18:51:57 -06:00
|
|
|
infinity limit (RLIM_INFINITY), the \-1 or 'unlimited' string can be passed.
|
2011-10-19 15:02:35 -05:00
|
|
|
|
2014-07-14 04:02:58 -05:00
|
|
|
Because of the nature of limits, the soft limit must be lower or equal to the
|
|
|
|
high limit (also called the ceiling). To see all available resource limits,
|
|
|
|
refer to the RESOURCE OPTIONS section.
|
2011-10-19 15:02:35 -05:00
|
|
|
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fIsoft\fP:\fIhard\fP Specify both limits."
|
|
|
|
.IP "\fIsoft\fP: Specify only the soft limit."
|
|
|
|
.IP ":\fIhard\fP Specify only the hard limit."
|
2014-07-21 09:09:38 -05:00
|
|
|
.IP "\fIvalue\fP Specify both limits to the same value."
|
2011-10-19 15:02:35 -05:00
|
|
|
|
|
|
|
.SH GENERAL OPTIONS
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-h, \-\-help\fP"
|
|
|
|
Display help text and exit.
|
|
|
|
.IP "\fB\-\-noheadings\fP"
|
|
|
|
Do not print a header line.
|
2011-10-19 15:02:35 -05:00
|
|
|
.IP "\fB\-o, \-\-output \fIlist\fP"
|
2014-07-14 04:02:58 -05:00
|
|
|
Define the output columns to use. If no output arrangement is specified,
|
|
|
|
then a default set is used.
|
|
|
|
Use \fB\-\-help\fP to get a list of all supported columns.
|
|
|
|
.IP "\fB\-p, \-\-pid\fP"
|
|
|
|
Specify the process id; if none is given, the running process will be used.
|
2011-11-07 02:57:46 -06:00
|
|
|
.IP "\fB\-\-raw\fP"
|
|
|
|
Use the raw output format.
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-\-verbose\fP"
|
|
|
|
Verbose mode.
|
|
|
|
.IP "\fB\-V, \-\-version\fP"
|
|
|
|
Display version information and exit.
|
2011-10-19 15:02:35 -05:00
|
|
|
|
|
|
|
.SH RESOURCE OPTIONS
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-c, \-\-core\fP[=\fIlimits\fR]"
|
2011-10-19 15:02:35 -05:00
|
|
|
Maximum size of a core file.
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-d, \-\-data\fP[=\fIlimits\fR]"
|
2011-10-19 15:02:35 -05:00
|
|
|
Maximum data size.
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-e, \-\-nice\fP[=\fIlimits\fR]"
|
2011-10-19 15:02:35 -05:00
|
|
|
Maximum nice priority allowed to raise.
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-f, \-\-fsize\fP[=\fIlimits\fR]"
|
2011-10-19 15:02:35 -05:00
|
|
|
Maximum file size.
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-i, \-\-sigpending\fP[=\fIlimits\fR]"
|
2011-11-17 01:44:48 -06:00
|
|
|
Maximum number of pending signals.
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-l, \-\-memlock\fP[=\fIlimits\fR]"
|
2011-10-19 15:02:35 -05:00
|
|
|
Maximum locked-in-memory address space.
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-m, \-\-rss\fP[=\fIlimits\fR]"
|
2011-10-19 15:02:35 -05:00
|
|
|
Maximum Resident Set Size (RSS).
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-n, \-\-nofile\fP[=\fIlimits\fR]"
|
2011-11-17 01:44:48 -06:00
|
|
|
Maximum number of open files.
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-q, \-\-msgqueue\fP[=\fIlimits\fR]"
|
2011-11-17 01:44:48 -06:00
|
|
|
Maximum number of bytes in POSIX message queues.
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-r, \-\-rtprio\fP[=\fIlimits\fR]"
|
2011-10-19 15:02:35 -05:00
|
|
|
Maximum real-time priority.
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-s, \-\-stack\fP[=\fIlimits\fR]"
|
2011-10-19 15:02:35 -05:00
|
|
|
Maximum size of the stack.
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-t, \-\-cpu\fP[=\fIlimits\fR]"
|
2011-10-19 15:02:35 -05:00
|
|
|
CPU time, in seconds.
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-u, \-\-nproc\fP[=\fIlimits\fR]"
|
2011-11-17 01:44:48 -06:00
|
|
|
Maximum number of processes.
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-v, \-\-as\fP[=\fIlimits\fR]"
|
2011-10-19 15:02:35 -05:00
|
|
|
Address space limit.
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-x, \-\-locks\fP[=\fIlimits\fR]"
|
2011-11-17 01:44:48 -06:00
|
|
|
Maximum number of file locks held.
|
2014-07-14 04:02:58 -05:00
|
|
|
.IP "\fB\-y, \-\-rttime\fP[=\fIlimits\fR]"
|
2011-10-19 15:02:35 -05:00
|
|
|
Timeout for real-time tasks.
|
|
|
|
|
|
|
|
.SH EXAMPLES
|
|
|
|
.IP "\fBprlimit \-\-pid 13134\fP"
|
|
|
|
Display limit values for all current resources.
|
2019-12-15 18:51:57 -06:00
|
|
|
.IP "\fBprlimit \-\-pid 13134 \-\-rss \-\-nofile=1024:4095\fP"
|
2014-07-14 04:02:58 -05:00
|
|
|
Display the limits of the RSS, and set the soft and hard limits for the number
|
2011-10-19 15:02:35 -05:00
|
|
|
of open files to 1024 and 4095, respectively.
|
2019-12-15 18:51:57 -06:00
|
|
|
.IP "\fBprlimit \-\-pid 13134 \-\-nproc=512:\fP"
|
2011-11-17 01:44:48 -06:00
|
|
|
Modify only the soft limit for the number of processes.
|
2019-12-15 18:51:57 -06:00
|
|
|
.IP "\fBprlimit \-\-pid $$ \-\-nproc=unlimited\fP"
|
2014-07-14 04:02:58 -05:00
|
|
|
Set for the current process both the soft and ceiling values for the number of
|
2015-02-25 08:07:59 -06:00
|
|
|
processes to unlimited.
|
2019-12-15 18:51:57 -06:00
|
|
|
.IP "\fBprlimit \-\-cpu=10 sort \-u hugefile\fP"
|
2014-07-21 09:09:38 -05:00
|
|
|
Set both the soft and hard CPU time limit to ten seconds and run 'sort'.
|
2011-10-19 15:02:35 -05:00
|
|
|
|
|
|
|
.SH "SEE ALSO"
|
2019-08-24 16:34:16 -05:00
|
|
|
.BR ulimit (1p),
|
2016-11-10 04:59:27 -06:00
|
|
|
.BR prlimit (2)
|
2011-10-19 15:02:35 -05:00
|
|
|
|
|
|
|
.SH NOTES
|
2014-07-14 04:02:58 -05:00
|
|
|
The prlimit system call is supported since Linux 2.6.36, older kernels will
|
2011-10-19 15:02:35 -05:00
|
|
|
break this program.
|
|
|
|
|
|
|
|
.SH AUTHORS
|
|
|
|
.nf
|
|
|
|
Davidlohr Bueso <dave@gnu.org> - In memory of Dennis M. Ritchie.
|
|
|
|
.fi
|
|
|
|
.SH AVAILABILITY
|
|
|
|
The prlimit command is part of the util-linux package and is available from
|
2016-12-17 02:06:57 -06:00
|
|
|
https://www.kernel.org/pub/linux/utils/util-linux/.
|