Main index | Section 8 | Options |
If a filter argument is specified, only rules matching the filter are displayed. The options are as follows:
| |
Add rule to the RCTL database. | |
| |
Display rules applicable to the process defined by filter. Note that this is different from showing the rules when called without any options, as it shows not just the rules with subject equal to that of process, but also rules for the user, jail, and login class applicable to the process. | |
| |
Remove rules matching filter from the RCTL database. | |
| |
Display resource utilization for a subject ( process, user, loginclass or jail ) matching the filter. | |
| |
"Human-readable" output. Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte. | |
| |
Display user IDs numerically rather than converting them to a user name. | |
Modifying rules affects all currently running and future processes matching the rule.
subject | defines the kind of entity the rule applies to. It can be either process, user, loginclass, or jail. |
subject-id | |
identifies the subject. It can be a process ID, user name, numerical user ID, login class name from login.conf(5), or jail name. | |
resource | identifies the resource the rule controls. See the RESOURCES section below for details. |
action | defines what will happen when a process exceeds the allowed amount. See the ACTIONS section below for details. |
amount | defines how much of the resource a process can use before the defined action triggers. Resources which limit bytes may use prefixes from expand_number(3). |
per | defines what entity the amount gets accounted for. For example, rule "loginclass:users:vmemoryuse:deny=100M/process" means that each process of any user belonging to login class "users" may allocate up to 100MB of virtual memory. Rule "loginclass:users:vmemoryuse:deny=100M/user" would mean that for each user belonging to the login class "users", the sum of virtual memory allocated by all the processes of that user will not exceed 100MB. Rule "loginclass:users:vmemoryuse:deny=100M/loginclass" would mean that the sum of virtual memory allocated by all processes of all users belonging to that login class will not exceed 100MB. |
A valid rule has all those fields specified, except for per, which defaults to the value of subject.
A filter is a rule for which one of more fields other than per is left empty. For example, a filter that matches every rule could be written as ":::=/", or, in short, ":". A filter that matches all the login classes would be "loginclass:". A filter that matches all defined rules for maxproc resource would be "::maxproc".
process | numerical Process ID |
user | user name or numerical User ID |
loginclass | login class fromlogin.conf(5) |
jail | jail name |
cputime | CPU time, in seconds |
datasize | data size, in bytes |
stacksize | stack size, in bytes |
coredumpsize | core dump size, in bytes |
memoryuse | resident set size, in bytes |
memorylocked | locked memory, in bytes |
maxproc | number of processes |
openfiles | file descriptor table size |
vmemoryuse | address space limit, in bytes |
pseudoterminals | number of PTYs |
swapuse | swap space that may be reserved or used, in bytes |
nthr | number of threads |
msgqqueued | number of queued SysV messages |
msgqsize | SysV message queue size, in bytes |
nmsgq | number of SysV message queues |
nsem | number of SysV semaphores |
nsemop | number of SysV semaphores modified in a single semop(2) call |
nshm | number of SysV shared memory segments |
shmsize | SysV shared memory size, in bytes |
wallclock | wallclock time, in seconds |
pcpu | %CPU, in percents of a single CPU core |
readbps | filesystem reads, in bytes per second |
writebps | filesystem writes, in bytes per second |
readiops | filesystem reads, in operations per second |
writeiops | filesystem writes, in operations per second |
deny | deny the allocation; not supported for cputime, wallclock, readbps, writebps, readiops, and writeiops |
log | log a warning to the console |
devctl | send notification todevd(8) using system = "RCTL", subsystem = "rule", type = "matched" |
sig* | e.g. sigterm; send a signal to the offending process. See signal(3) for a list of supported signals |
throttle | slow down process execution; only supported for readbps, writebps, readiops, and writeiops. |
Not all actions are supported for all resources. Attempting to add a rule with an action not supported by a given resource will result in error.
Fl
Remove all RCTL rules:
Fl
Display resource utilization information for jail named "www":
Fl
Display all the rules applicable to process with PID 512:
Fl
Display all rules:
rctl
Display all rules matching user "joe":
Ar
Display all rules matching login classes:
Ar
The readiops and writeiops counters are only approximations. Like readbps and writebps, they are calculated in the filesystem layer, where it is difficult or even impossible to observe actual disk device operations.
The writebps and writeiops resources generally account for writes to the filesystem cache, not to actual devices.
RCTL (8) | February 26, 2018 |
Main index | Section 8 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.