summaryrefslogtreecommitdiffstats
path: root/sys-utils/prlimit.1
blob: b710ab433d9751df0fdd7f836baab618a406e16f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
'\" t
.\"     Title: prlimit
.\"    Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
.\"      Date: 2024-05-01
.\"    Manual: User Commands
.\"    Source: util-linux 2.40.1
.\"  Language: English
.\"
.TH "PRLIMIT" "1" "2024-05-01" "util\-linux 2.40.1" "User Commands"
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.ss \n[.ss] 0
.nh
.ad l
.de URL
\fI\\$2\fP <\\$1>\\$3
..
.als MTO URL
.if \n[.g] \{\
.  mso www.tmac
.  am URL
.    ad l
.  .
.  am MTO
.    ad l
.  .
.  LINKSTYLE blue R < >
.\}
.SH "NAME"
prlimit \- get and set process resource limits
.SH "SYNOPSIS"
.sp
\fBprlimit\fP [options] [\fB\-\-resource\fP[=\fIlimits\fP]] [\fB\-\-pid\fP \fIPID\fP]
.sp
\fBprlimit\fP [options] [\fB\-\-resource\fP[=\fIlimits\fP]] \fIcommand\fP [\fIargument\fP...]
.SH "DESCRIPTION"
.sp
Given a process ID and one or more resources, \fBprlimit\fP tries to retrieve and/or modify the limits.
.sp
When \fIcommand\fP is given, \fBprlimit\fP will run this command with the given arguments.
.sp
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\fP 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 infinity limit (\fBRLIM_INFINITY\fP), the \-1 or \*(Aqunlimited\*(Aq string can be passed.
.sp
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 \fBRESOURCE OPTIONS\fP section.
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.  sp -1
.  IP \(bu 2.3
.\}
\fIsoft\fP:\fIhard\fP Specify both limits.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.  sp -1
.  IP \(bu 2.3
.\}
\fIsoft\fP: Specify only the soft limit.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.  sp -1
.  IP \(bu 2.3
.\}
:\fIhard\fP Specify only the hard limit.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.  sp -1
.  IP \(bu 2.3
.\}
\fIvalue\fP Specify both limits to the same value.
.RE
.SH "GENERAL OPTIONS"
.sp
\fB\-\-noheadings\fP
.RS 4
Do not print a header line.
.RE
.sp
\fB\-o\fP, \fB\-\-output\fP \fIlist\fP
.RS 4
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.
.RE
.sp
\fB\-p\fP, \fB\-\-pid\fP
.RS 4
Specify the process id; if none is given, the running process will be used.
.RE
.sp
\fB\-\-raw\fP
.RS 4
Use the raw output format.
.RE
.sp
\fB\-\-verbose\fP
.RS 4
Verbose mode.
.RE
.sp
\fB\-h\fP, \fB\-\-help\fP
.RS 4
Display help text and exit.
.RE
.sp
\fB\-V\fP, \fB\-\-version\fP
.RS 4
Print version and exit.
.RE
.SH "RESOURCE OPTIONS"
.sp
\fB\-c\fP, \fB\-\-core\fP[=\fIlimits\fP]
.RS 4
Maximum size of a core file.
.RE
.sp
\fB\-d\fP, \fB\-\-data\fP[=\fIlimits\fP]
.RS 4
Maximum data size.
.RE
.sp
\fB\-e\fP, \fB\-\-nice\fP[=\fIlimits\fP]
.RS 4
Maximum nice priority allowed to raise.
.RE
.sp
\fB\-f\fP, \fB\-\-fsize\fP[=\fIlimits\fP]
.RS 4
Maximum file size.
.RE
.sp
\fB\-i\fP, \fB\-\-sigpending\fP[=\fIlimits\fP]
.RS 4
Maximum number of pending signals.
.RE
.sp
\fB\-l\fP, \fB\-\-memlock\fP[=\fIlimits\fP]
.RS 4
Maximum locked\-in\-memory address space.
.RE
.sp
\fB\-m\fP, \fB\-\-rss\fP[=\fIlimits\fP]
.RS 4
Maximum Resident Set Size (RSS).
.RE
.sp
\fB\-n\fP, \fB\-\-nofile\fP[=\fIlimits\fP]
.RS 4
Maximum number of open files.
.RE
.sp
\fB\-q\fP, \fB\-\-msgqueue\fP[=\fIlimits\fP]
.RS 4
Maximum number of bytes in POSIX message queues.
.RE
.sp
\fB\-r\fP, \fB\-\-rtprio\fP[=\fIlimits\fP]
.RS 4
Maximum real\-time priority.
.RE
.sp
\fB\-s\fP, \fB\-\-stack\fP[=\fIlimits\fP]
.RS 4
Maximum size of the stack.
.RE
.sp
\fB\-t\fP, \fB\-\-cpu\fP[=\fIlimits\fP]
.RS 4
CPU time, in seconds.
.RE
.sp
\fB\-u\fP, \fB\-\-nproc\fP[=\fIlimits\fP]
.RS 4
Maximum number of processes.
.RE
.sp
\fB\-v\fP, \fB\-\-as\fP[=\fIlimits\fP]
.RS 4
Address space limit.
.RE
.sp
\fB\-x\fP, \fB\-\-locks\fP[=\fIlimits\fP]
.RS 4
Maximum number of file locks held.
.RE
.sp
\fB\-y\fP, \fB\-\-rttime\fP[=\fIlimits\fP]
.RS 4
Timeout for real\-time tasks.
.RE
.SH "NOTES"
.sp
The \fBprlimit\fP(2) system call is supported since Linux 2.6.36, older kernels will break this program.
.SH "EXAMPLES"
.sp
\fBprlimit \-\-pid 13134\fP
.RS 4
Display limit values for all current resources.
.RE
.sp
\fBprlimit \-\-pid 13134 \-\-rss \-\-nofile=1024:4095\fP
.RS 4
Display the limits of the RSS, and set the soft and hard limits for the number of open files to 1024 and 4095, respectively.
.RE
.sp
\fBprlimit \-\-pid 13134 \-\-nproc=512:\fP
.RS 4
Modify only the soft limit for the number of processes.
.RE
.sp
\fBprlimit \-\-pid $$ \-\-nproc=unlimited\fP
.RS 4
Set for the current process both the soft and ceiling values for the number of processes to unlimited.
.RE
.sp
\fBprlimit \-\-cpu=10 sort \-u hugefile\fP
.RS 4
Set both the soft and hard CPU time limit to ten seconds and run \fBsort\fP(1).
.RE
.SH "AUTHORS"
.sp
.MTO "dave\(atgnu.org" "Davidlohr Bueso" ""
\- In memory of Dennis M. Ritchie.
.SH "SEE ALSO"
.sp
\fBulimit\fP(1p),
\fBprlimit\fP(2)
.SH "REPORTING BUGS"
.sp
For bug reports, use the issue tracker at \c
.URL "https://github.com/util\-linux/util\-linux/issues" "" "."
.SH "AVAILABILITY"
.sp
The \fBprlimit\fP command is part of the util\-linux package which can be downloaded from \c
.URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux Kernel Archive" "."