RESOURCE_CONTROLS(5) Standards, Environments, and Macros RESOURCE_CONTROLS(5) NNAAMMEE resource_controls - resource controls available through project database DDEESSCCRRIIPPTTIIOONN The resource controls facility is configured through the project database. See pprroojjeecctt(4). You can set and modify resource controls through the following utilities: o pprrccttll(1) o pprroojjaadddd(1M) o pprroojjmmoodd(1M) o rrccttllaaddmm(1M) In a program, you use sseettrrccttll(2) to set resource control values. In addition to the preceding resource controls, there are resource pools, accessible through the ppoooollaaddmm(1M) and ppoooollccffgg(1M) utilities. In a program, resource pools can be manipulated through the lliibbppooooll(3LIB) library. The following are the resource controls are available: pprroocceessss..mmaaxx--aaddddrreessss--ssppaaccee Maximum amount of address space, as summed over segment sizes, that is available to this process, expressed as a number of bytes. pprroocceessss..mmaaxx--ccoorree--ssiizzee Maximum size of a core file created by this process, expressed as a number of bytes. pprroocceessss..mmaaxx--ccppuu--ttiimmee Maximum CPU time that is available to this process, expressed as a number of seconds. pprroocceessss..mmaaxx--ddaattaa--ssiizzee Maximum heap memory available to this process, expressed as a number of bytes. pprroocceessss..mmaaxx--ffiillee--ddeessccrriippttoorr Maximum file descriptor index available to this process, expressed as an integer. pprroocceessss..mmaaxx--ffiillee--ssiizzee Maximum file offset available for writing by this process, expressed as a number of bytes. pprroocceessss..mmaaxx--mmssgg--mmeessssaaggeess Maximum number of messages on a message queue (value copied from the resource control at mmssggggeett(()) time), expressed as an integer. pprroocceessss..mmaaxx--mmssgg--qqbbyytteess Maximum number of bytes of messages on a message queue (value copied from the resource control at mmssggggeett(()) time), expressed as a number of bytes. pprroocceessss..mmaaxx--ppoorrtt--eevveennttss Maximum allowable number of events per event port, expressed as an integer. pprroocceessss..mmaaxx--sseemm--nnsseemmss Maximum number of semaphores allowed per semaphore set, expressed as an integer. pprroocceessss..mmaaxx--sseemm--ooppss Maximum number of semaphore operations allowed per sseemmoopp call (value copied from the resource control at sseemmggeett(()) time). Expressed as an integer, specifying the number of operations. pprroocceessss..mmaaxx--ssiiggqquueeuuee--ssiizzee Maximum number of outstanding queued signals. pprroocceessss..mmaaxx--ssttaacckk--ssiizzee Maximum stack memory segment available to this process, expressed as a number of bytes. pprroojjeecctt..ccppuu--ccaapp Maximum amount of CPU resources that a project can use. The unit used is the percentage of a single CPU that can be used by all user threads in a project. Expressed as an integer. The cap does not apply to threads running in real-time scheduling class. This resource control does not support the ssyysslloogg action. pprroojjeecctt..ccppuu--sshhaarreess Number of CPU shares granted to a project for use with the fair share scheduler (see FFSSSS(7)). The unit used is the number of shares (an integer). This resource control does not support the ssyysslloogg action. pprroojjeecctt..mmaaxx--ccoonnttrraaccttss Maximum number of contracts allowed in a project, expressed as an integer. pprroojjeecctt..mmaaxx--ccrryyppttoo--mmeemmoorryy Maximum amount of kernel memory that can be used for crypto operations. Allocations in the kernel for buffers and session- related structures are charged against this resource control. pprroojjeecctt..mmaaxx--lloocckkeedd--mmeemmoorryy Total amount of physical memory locked by device drivers and user processes (including D/ISM), expressed as a number of bytes. pprroojjeecctt..mmaaxx--llwwppss Maximum number of LWPs simultaneously available to a project, expressed as an integer. pprroojjeecctt..mmaaxx--mmssgg--iiddss Maximum number of message queue IDs allowed for a project, expressed as an integer. pprroojjeecctt..mmaaxx--ppoorrtt--iiddss Maximum allowable number of event ports, expressed as an integer. pprroojjeecctt..mmaaxx--sseemm--iiddss Maximum number of semaphore IDs allowed for a project, expressed as an integer. pprroojjeecctt..mmaaxx--sshhmm--iiddss Maximum number of shared memory IDs allowed for a project, expressed as an integer. pprroojjeecctt..mmaaxx--sshhmm--mmeemmoorryy Total amount of shared memory allowed for a project, expressed as a number of bytes. pprroojjeecctt..mmaaxx--ttaasskkss Maximum number of tasks allowable in a project, expressed as an integer. pprroojjeecctt..ppooooll Binds a specified resource pool with a project. rrccaapp..mmaaxx--rrssss The total amount of physical memory, in bytes, that is available to processes in a project. ttaasskk..mmaaxx--ccppuu--ttiimmee Maximum CPU time that is available to this task's processes, expressed as a number of seconds. ttaasskk..mmaaxx--llwwppss Maximum number of LWPs simultaneously available to this task's processes, expressed as an integer. The following zone-wide resource controls are available: zzoonnee..ccppuu--ccaapp Sets a limit on the amount of CPU time that can be used by a zone. The unit used is the percentage of a single CPU that can be used by all user threads in a zone. Expressed as an integer. When projects within the capped zone have their own caps, the minimum value takes precedence. This resource control does not support the ssyysslloogg action. zzoonnee..ccppuu--sshhaarreess Sets a limit on the number of fair share scheduler (FSS) CPU shares for a zone. CPU shares are first allocated to the zone, and then further subdivided among projects within the zone as specified in the pprroojjeecctt..ccppuu--sshhaarreess entries. Expressed as an integer. This resource control does not support the ssyysslloogg action. zzoonnee..mmaaxx--lloocckkeedd--mmeemmoorryy Total amount of physical locked memory available to a zone. zzoonnee..mmaaxx--llwwppss Enhances resource isolation by preventing too many LWPs in one zone from affecting other zones. A zone's total LWPs can be further subdivided among projects within the zone within the zone by using pprroojjeecctt..mmaaxx--llwwppss entries. Expressed as an integer. zzoonnee..mmaaxx--mmssgg--iiddss Maximum number of message queue IDs allowed for a zone, expressed as an integer. zzoonnee..mmaaxx--sseemm--iiddss Maximum number of semaphore IDs allowed for a zone, expressed as an integer. zzoonnee..mmaaxx--sshhmm--iiddss Maximum number of shared memory IDs allowed for a zone, expressed as an integer. zzoonnee..mmaaxx--sshhmm--mmeemmoorryy Total amount of shared memory allowed for a zone, expressed as a number of bytes. zzoonnee..mmaaxx--sswwaapp Total amount of swap that can be consumed by user process address space mappings and ttmmppffss mounts for this zone. See zzoonneess(5). UUnniittss UUsseedd iinn RReessoouurrccee CCoonnttrroollss Resource controls can be expressed as in units of size (bytes), time (seconds), or as a count (integer). These units use the strings specified below. Category Res Ctrl Modifier Scale Type String ----------- ----------- -------- ----- Size bytes B 1 KB 2^10 MB 2^20 GB 2^30 TB 2^40 PB 2^50 EB 2^60 Time seconds s 1 Ks 10^3 Ms 10^6 Gs 10^9 Ts 10^12 Ps 10^15 Es 10^18 Count integer none 1 K 10^3 M 10^6 G 10^9 T 10^12 P 10^15 Es 10^18 Scaled values can be used with resource controls. The following example shows a scaled threshold value: task.max-lwps=(priv,1K,deny) In the pprroojjeecctt file, the value 11KK is expanded to 11000000: task.max-lwps=(priv,1000,deny) A second example uses a larger scaled value: process.max-file-size=(priv,5G,deny) In the pprroojjeecctt file, the value 55GG is expanded to 55336688770099112200: process.max-file-size=(priv,5368709120,deny) The preceding examples use the scaling factors specified in the table above. Note that unit modifiers (for example, 55GG) are accepted by the pprrccttll(1), pprroojjaadddd(1M), and pprroojjmmoodd(1M) commands. You cannot use unit modifiers in the project database itself. RReessoouurrccee CCoonnttrrooll VVaalluueess aanndd PPrriivviilleeggee LLeevveellss A threshold value on a resource control constitutes a point at which local actions can be triggered or global actions, such as logging, can occur. Each threshold value on a resource control must be associated with a privilege level. The privilege level must be one of the following three types: bbaassiicc Can be modified by the owner of the calling process. pprriivviilleeggeedd Can be modified by the current process (requiring ssyyss__rreessoouurrccee privilege) or by pprrccttll(1) (requiring pprroocc__oowwnneerr privilege). ssyysstteemm Fixed for the duration of the operating system instance. A resource control is guaranteed to have one ssyysstteemm value, which is defined by the system, or resource provider. The ssyysstteemm value represents how much of the resource the current implementation of the operating system is capable of providing. Any number of privileged values can be defined, and only one basic value is allowed. Operations that are performed without specifying a privilege value are assigned a basic privilege by default. The privilege level for a resource control value is defined in the privilege field of the resource control block as RRCCTTLL__BBAASSIICC, RRCCTTLL__PPRRIIVVIILLEEGGEEDD, or RRCCTTLL__SSYYSSTTEEMM. See sseettrrccttll(2) for more information. You can use the pprrccttll command to modify values that are associated with basic and privileged levels. In specifying the privilege level of pprriivviilleeggeedd, you can use the abbreviation pprriivv. For example: task.max-lwps=(priv,1K,deny) GGlloobbaall aanndd LLooccaall AAccttiioonnss oonn RReessoouurrccee CCoonnttrrooll VVaalluueess There are two categories of actions on resource control values: global and local. Global actions apply to resource control values for every resource control on the system. You can use rrccttllaaddmm(1M) to perform the following actions: o Display the global state of active system resource controls. o Set global logging actions. You can disable or enable the global logging action on resource controls. You can set the ssyysslloogg action to a specific degree by assigning a severity level, ssyysslloogg==_l_e_v_e_l. The possible settings for _l_e_v_e_l are as follows: o ddeebbuugg o iinnffoo o nnoottiiccee o wwaarrnniinngg o eerrrr o ccrriitt o aalleerrtt o eemmeerrgg By default, there is no global logging of resource control violations. Local actions are taken on a process that attempts to exceed the control value. For each threshold value that is placed on a resource control, you can associate one or more actions. There are three types of local actions: nnoonnee, ddeennyy, and ssiiggnnaall==. These three actions are used as follows: nnoonnee No action is taken on resource requests for an amount that is greater than the threshold. This action is useful for monitoring resource usage without affecting the progress of applications. You can also enable a global message that displays when the resource control is exceeded, while, at the same time, the process exceeding the threshhold is not affected. ddeennyy You can deny resource requests for an amount that is greater than the threshold. For example, a ttaasskk..mmaaxx--llwwppss resource control with action deny causes a ffoorrkk(()) system call to fail if the new process would exceed the control value. See the ffoorrkk(2). ssiiggnnaall== You can enable a global signal message action when the resource control is exceeded. A signal is sent to the process when the threshold value is exceeded. Additional signals are not sent if the process consumes additional resources. Available signals are listed below. Not all of the actions can be applied to every resource control. For example, a process cannot exceed the number of CPU shares assigned to the project of which it is a member. Therefore, a deny action is not allowed on the pprroojjeecctt..ccppuu--sshhaarreess resource control. Due to implementation restrictions, the global properties of each control can restrict the range of available actions that can be set on the threshold value. (See rrccttllaaddmm(1M).) A list of available signal actions is presented in the following list. For additional information about signals, see ssiiggnnaall(3HEAD). The following are the signals available to resource control values: SSIIGGAABBRRTT Terminate the process. SSIIGGHHUUPP Send a hangup signal. Occurs when carrier drops on an open line. Signal sent to the process group that controls the terminal. SSIIGGTTEERRMM Terminate the process. Termination signal sent by software. SSIIGGKKIILLLL Terminate the process and kill the program. SSIIGGSSTTOOPP Stop the process. Job control signal. SSIIGGXXRREESS Resource control limit exceeded. Generated by resource control facility. SSIIGGXXFFSSZZ Terminate the process. File size limit exceeded. Available only to resource controls with the RRCCTTLL__GGLLOOBBAALL__FFIILLEE__SSIIZZEE property (pprroocceessss..mmaaxx--ffiillee--ssiizzee). See rrccttllbbllkk__sseett__vvaalluuee(3C). SSIIGGXXCCPPUU Terminate the process. CPU time limit exceeded. Available only to resource controls with the RRCCTTLL__GGLLOOBBAALL__CCPPUUTTIIMMEE property (pprroocceessss..mmaaxx--ccppuu--ttiimmee). See rrccttllbbllkk__sseett__vvaalluuee(3C). RReessoouurrccee CCoonnttrrooll FFllaaggss aanndd PPrrooppeerrttiieess Each resource control on the system has a certain set of associated properties. This set of properties is defined as a set of flags, which are associated with all controlled instances of that resource. Global flags cannot be modified, but the flags can be retrieved by using either rrccttllaaddmm(1M) or the sseettrrccttll(2) system call. Local flags define the default behavior and configuration for a specific threshold value of that resource control on a specific process or process collective. The local flags for one threshold value do not affect the behavior of other defined threshold values for the same resource control. However, the global flags affect the behavior for every value associated with a particular control. Local flags can be modified, within the constraints supplied by their corresponding global flags, by the pprrccttll command or the sseettrrccttll system call. See sseettrrccttll(2). For the complete list of local flags, global flags, and their definitions, see rrccttllbbllkk__sseett__vvaalluuee(3C). To determine system behavior when a threshold value for a particular resource control is reached, use rrccttllaaddmm to display the global flags for the resource control . For example, to display the values for pprroocceessss..mmaaxx--ccppuu--ttiimmee, enter: $ rctladm process.max-cpu-time process.max-cpu-time syslog=off [ lowerable no-deny cpu-time inf seconds ] The global flags indicate the following: lloowweerraabbllee Superuser privileges are not required to lower the privileged values for this control. nnoo--ddeennyy Even when threshold values are exceeded, access to the resource is never denied. ccppuu--ttiimmee SSIIGGXXCCPPUU is available to be sent when threshold values of this resource are reached. sseeccoonnddss The time value for the resource control. Use the pprrccttll command to display local values and actions for the resource control. For example: $ prctl -n process.max-cpu-time $$ process 353939: -ksh NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT process.max-cpu-time privileged 18.4Es inf signal=XCPU - system 18.4Es inf none The mmaaxx (RRCCTTLL__LLOOCCAALL__MMAAXXIIMMAALL) flag is set for both threshold values, and the iinnff (RRCCTTLL__GGLLOOBBAALL__IINNFFIINNIITTEE) flag is defined for this resource control. An iinnff value has an infinite quantity. The value is never enforced. Hence, as configured, both threshold quantities represent infinite values that are never exceeded. RReessoouurrccee CCoonnttrrooll EEnnffoorrcceemmeenntt More than one resource control can exist on a resource. A resource control can exist at each containment level in the process model. If resource controls are active on the same resource at different container levels, the smallest container's control is enforced first. Thus, action is taken on pprroocceessss..mmaaxx--ccppuu--ttiimmee before ttaasskk..mmaaxx--ccppuu--ttiimmee if both controls are encountered simultaneously. AATTTTRRIIBBUUTTEESS See aattttrriibbuutteess(5) for a description of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Interface Stability | Evolving | +--------------------+-----------------+ SSEEEE AALLSSOO pprrccttll(1), ppoooollaaddmm(1M), ppoooollccffgg(1M), pprroojjaadddd(1M), pprroojjmmoodd(1M), rrccttllaaddmm(1M), sseettrrccttll(2), rrccttllbbllkk__sseett__vvaalluuee(3C), lliibbppooooll(3LIB), pprroojjeecctt(4), aattttrriibbuutteess(5), FFSSSS(7) _S_y_s_t_e_m _A_d_m_i_n_i_s_t_r_a_t_i_o_n _G_u_i_d_e_: _V_i_r_t_u_a_l_i_z_a_t_i_o_n _U_s_i_n_g _t_h_e _S_o_l_a_r_i_s _O_p_e_r_a_t_i_n_g _S_y_s_t_e_m July 19, 2013 RESOURCE_CONTROLS(5)