Print this page
6591 resource_controls(5) should talk about project.cpu-cap not project.cpu-caps
   1 '\" te
   2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
   3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   6 .TH RESOURCE_CONTROLS 5 "Jul 19, 2013"
   7 .SH NAME
   8 resource_controls \- resource controls available through project database
   9 .SH DESCRIPTION
  10 .sp
  11 .LP
  12 The resource controls facility is configured through the project database. See
  13 \fBproject\fR(4). You can set and modify resource controls through the
  14 following utilities:
  15 .RS +4
  16 .TP
  17 .ie t \(bu
  18 .el o
  19 \fBprctl\fR(1)
  20 .RE
  21 .RS +4
  22 .TP
  23 .ie t \(bu
  24 .el o
  25 \fBprojadd\fR(1M)
  26 .RE
  27 .RS +4
  28 .TP
  29 .ie t \(bu
  30 .el o


 175 .ad
 176 .sp .6
 177 .RS 4n
 178 Maximum number of outstanding queued signals.
 179 .RE
 180 
 181 .sp
 182 .ne 2
 183 .na
 184 \fB\fBprocess.max-stack-size\fR\fR
 185 .ad
 186 .sp .6
 187 .RS 4n
 188 Maximum stack memory segment available to this process, expressed as a number
 189 of bytes.
 190 .RE
 191 
 192 .sp
 193 .ne 2
 194 .na
 195 \fB\fBproject.cpu-caps\fR\fR
 196 .ad
 197 .sp .6
 198 .RS 4n
 199 Maximum amount of CPU resources that a project can use. The unit used is the
 200 percentage of a single CPU that can be used by all user threads in a project.
 201 Expressed as an integer. The cap does not apply to threads running in real-time
 202 scheduling class. This resource control does not support the \fBsyslog\fR
 203 action.
 204 .RE
 205 
 206 .sp
 207 .ne 2
 208 .na
 209 \fB\fBproject.cpu-shares\fR\fR
 210 .ad
 211 .sp .6
 212 .RS 4n
 213 Number of CPU shares granted to a project for use with the fair share scheduler
 214 (see \fBFSS\fR(7)). The unit used is the number of shares (an integer). This
 215 resource control does not support the \fBsyslog\fR action.


 460 .RS 4n
 461 Total amount of shared memory allowed for a zone, expressed as a number of
 462 bytes.
 463 .RE
 464 
 465 .sp
 466 .ne 2
 467 .na
 468 \fB\fBzone.max-swap\fR\fR
 469 .ad
 470 .sp .6
 471 .RS 4n
 472 Total amount of swap that can be consumed by user process address space
 473 mappings and \fBtmpfs\fR mounts for this zone.
 474 .RE
 475 
 476 .sp
 477 .LP
 478 See \fBzones\fR(5).
 479 .SS "Units Used in Resource Controls"
 480 .sp
 481 .LP
 482 Resource controls can be expressed as in units of size (bytes), time (seconds),
 483 or as a count (integer). These units use the strings specified below.
 484 .sp
 485 .in +2
 486 .nf
 487 Category             Res Ctrl      Modifier  Scale
 488                      Type String
 489 -----------          -----------   --------  -----
 490 Size                 bytes         B         1
 491                                    KB        2^10
 492                                    MB        2^20
 493                                    GB        2^30
 494                                    TB        2^40
 495                                    PB        2^50
 496                                    EB        2^60
 497 
 498 Time                 seconds       s         1
 499                                    Ks        10^3
 500                                    Ms        10^6


 546 
 547 .sp
 548 .LP
 549 In the \fBproject\fR file, the value \fB5G\fR is expanded to \fB5368709120\fR:
 550 .sp
 551 .in +2
 552 .nf
 553 process.max-file-size=(priv,5368709120,deny)
 554 .fi
 555 .in -2
 556 
 557 .sp
 558 .LP
 559 The preceding examples use the scaling factors specified in the table above.
 560 .sp
 561 .LP
 562 Note that unit modifiers (for example, \fB5G\fR) are accepted by the
 563 \fBprctl\fR(1), \fBprojadd\fR(1M), and \fBprojmod\fR(1M) commands. You cannot
 564 use unit modifiers in the project database itself.
 565 .SS "Resource Control Values and Privilege Levels"
 566 .sp
 567 .LP
 568 A threshold value on a resource control constitutes a point at which local
 569 actions can be triggered or global actions, such as logging, can occur.
 570 .sp
 571 .LP
 572 Each threshold value on a resource control must be associated with a privilege
 573 level. The privilege level must be one of the following three types:
 574 .sp
 575 .ne 2
 576 .na
 577 \fB\fBbasic\fR\fR
 578 .ad
 579 .sp .6
 580 .RS 4n
 581 Can be modified by the owner of the calling process.
 582 .RE
 583 
 584 .sp
 585 .ne 2
 586 .na


 615 assigned a basic privilege by default.
 616 .sp
 617 .LP
 618 The privilege level for a resource control value is defined in the privilege
 619 field of the resource control block as \fBRCTL_BASIC\fR, \fBRCTL_PRIVILEGED\fR,
 620 or \fBRCTL_SYSTEM\fR. See \fBsetrctl\fR(2) for more information. You can use
 621 the \fBprctl\fR command to modify values that are associated with basic and
 622 privileged levels.
 623 .sp
 624 .LP
 625 In specifying the privilege level of \fBprivileged\fR, you can use the
 626 abbreviation \fBpriv\fR. For example:
 627 .sp
 628 .in +2
 629 .nf
 630 task.max-lwps=(priv,1K,deny)
 631 .fi
 632 .in -2
 633 
 634 .SS "Global and Local Actions on Resource Control Values"
 635 .sp
 636 .LP
 637 There are two categories of actions on resource control values: global and
 638 local.
 639 .sp
 640 .LP
 641 Global actions apply to resource control values for every resource control on
 642 the system. You can use \fBrctladm\fR(1M) to perform the following actions:
 643 .RS +4
 644 .TP
 645 .ie t \(bu
 646 .el o
 647 Display the global state of active system resource controls.
 648 .RE
 649 .RS +4
 650 .TP
 651 .ie t \(bu
 652 .el o
 653 Set global logging actions.
 654 .RE
 655 .sp


 841 .sp .6
 842 .RS 4n
 843 Terminate the process. File size limit exceeded. Available only to resource
 844 controls with the \fBRCTL_GLOBAL_FILE_SIZE\fR property
 845 (\fBprocess.max-file-size\fR). See \fBrctlblk_set_value\fR(3C).
 846 .RE
 847 
 848 .sp
 849 .ne 2
 850 .na
 851 \fB\fBSIGXCPU\fR\fR
 852 .ad
 853 .sp .6
 854 .RS 4n
 855 Terminate the process. CPU time limit exceeded. Available only to resource
 856 controls with the \fBRCTL_GLOBAL_CPUTIME\fR property
 857 (\fBprocess.max-cpu-time\fR). See \fBrctlblk_set_value\fR(3C).
 858 .RE
 859 
 860 .SS "Resource Control Flags and Properties"
 861 .sp
 862 .LP
 863 Each resource control on the system has a certain set of associated properties.
 864 This set of properties is defined as a set of flags, which are associated with
 865 all controlled instances of that resource. Global flags cannot be modified, but
 866 the flags can be retrieved by using either \fBrctladm\fR(1M) or the
 867 \fBsetrctl\fR(2) system call.
 868 .sp
 869 .LP
 870 Local flags define the default behavior and configuration for a specific
 871 threshold value of that resource control on a specific process or process
 872 collective. The local flags for one threshold value do not affect the behavior
 873 of other defined threshold values for the same resource control. However, the
 874 global flags affect the behavior for every value associated with a particular
 875 control. Local flags can be modified, within the constraints supplied by their
 876 corresponding global flags, by the \fBprctl\fR command or the \fBsetrctl\fR
 877 system call. See \fBsetrctl\fR(2).
 878 .sp
 879 .LP
 880 For the complete list of local flags, global flags, and their definitions, see
 881 \fBrctlblk_set_value\fR(3C).


 946 .sp
 947 .in +2
 948 .nf
 949 $ prctl -n process.max-cpu-time $$
 950     process 353939: -ksh
 951     NAME    PRIVILEGE    VALUE    FLAG   ACTION              RECIPIENT
 952  process.max-cpu-time
 953          privileged   18.4Es    inf   signal=XCPU                 -
 954          system       18.4Es    inf   none
 955 .fi
 956 .in -2
 957 
 958 .sp
 959 .LP
 960 The \fBmax\fR (\fBRCTL_LOCAL_MAXIMAL\fR) flag is set for both threshold values,
 961 and the \fBinf\fR (\fBRCTL_GLOBAL_INFINITE\fR) flag is defined for this
 962 resource control. An \fBinf\fR value has an infinite quantity. The value is
 963 never enforced. Hence, as configured, both threshold quantities represent
 964 infinite values that are never exceeded.
 965 .SS "Resource Control Enforcement"
 966 .sp
 967 .LP
 968 More than one resource control can exist on a resource. A resource control can
 969 exist at each containment level in the process model. If resource controls are
 970 active on the same resource at different container levels, the smallest
 971 container's control is enforced first. Thus, action is taken on
 972 \fBprocess.max-cpu-time\fR before \fBtask.max-cpu-time\fR if both controls are
 973 encountered simultaneously.
 974 .SH ATTRIBUTES
 975 .sp
 976 .LP
 977 See \fBattributes\fR(5) for a description of the following attributes:
 978 .sp
 979 
 980 .sp
 981 .TS
 982 box;
 983 c | c
 984 l | l .
 985 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 986 _
 987 Interface Stability     Evolving
 988 .TE
 989 
 990 .SH SEE ALSO
 991 .sp
 992 .LP
 993 \fBprctl\fR(1), \fBpooladm\fR(1M), \fBpoolcfg\fR(1M), \fBprojadd\fR(1M),
 994 \fBprojmod\fR(1M), \fBrctladm\fR(1M), \fBsetrctl\fR(2),
 995 \fBrctlblk_set_value\fR(3C), \fBlibpool\fR(3LIB), \fBproject\fR(4),
 996 \fBattributes\fR(5), \fBFSS\fR(7)
 997 .sp
 998 .LP
 999 \fISystem Administration Guide:  Virtualization Using the Solaris Operating
1000 System\fR
   1 '\" te
   2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
   3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   6 .TH RESOURCE_CONTROLS 5 "Jul 19, 2013"
   7 .SH NAME
   8 resource_controls \- resource controls available through project database
   9 .SH DESCRIPTION

  10 .LP
  11 The resource controls facility is configured through the project database. See
  12 \fBproject\fR(4). You can set and modify resource controls through the
  13 following utilities:
  14 .RS +4
  15 .TP
  16 .ie t \(bu
  17 .el o
  18 \fBprctl\fR(1)
  19 .RE
  20 .RS +4
  21 .TP
  22 .ie t \(bu
  23 .el o
  24 \fBprojadd\fR(1M)
  25 .RE
  26 .RS +4
  27 .TP
  28 .ie t \(bu
  29 .el o


 174 .ad
 175 .sp .6
 176 .RS 4n
 177 Maximum number of outstanding queued signals.
 178 .RE
 179 
 180 .sp
 181 .ne 2
 182 .na
 183 \fB\fBprocess.max-stack-size\fR\fR
 184 .ad
 185 .sp .6
 186 .RS 4n
 187 Maximum stack memory segment available to this process, expressed as a number
 188 of bytes.
 189 .RE
 190 
 191 .sp
 192 .ne 2
 193 .na
 194 \fB\fBproject.cpu-cap\fR\fR
 195 .ad
 196 .sp .6
 197 .RS 4n
 198 Maximum amount of CPU resources that a project can use. The unit used is the
 199 percentage of a single CPU that can be used by all user threads in a project.
 200 Expressed as an integer. The cap does not apply to threads running in real-time
 201 scheduling class. This resource control does not support the \fBsyslog\fR
 202 action.
 203 .RE
 204 
 205 .sp
 206 .ne 2
 207 .na
 208 \fB\fBproject.cpu-shares\fR\fR
 209 .ad
 210 .sp .6
 211 .RS 4n
 212 Number of CPU shares granted to a project for use with the fair share scheduler
 213 (see \fBFSS\fR(7)). The unit used is the number of shares (an integer). This
 214 resource control does not support the \fBsyslog\fR action.


 459 .RS 4n
 460 Total amount of shared memory allowed for a zone, expressed as a number of
 461 bytes.
 462 .RE
 463 
 464 .sp
 465 .ne 2
 466 .na
 467 \fB\fBzone.max-swap\fR\fR
 468 .ad
 469 .sp .6
 470 .RS 4n
 471 Total amount of swap that can be consumed by user process address space
 472 mappings and \fBtmpfs\fR mounts for this zone.
 473 .RE
 474 
 475 .sp
 476 .LP
 477 See \fBzones\fR(5).
 478 .SS "Units Used in Resource Controls"

 479 .LP
 480 Resource controls can be expressed as in units of size (bytes), time (seconds),
 481 or as a count (integer). These units use the strings specified below.
 482 .sp
 483 .in +2
 484 .nf
 485 Category             Res Ctrl      Modifier  Scale
 486                      Type String
 487 -----------          -----------   --------  -----
 488 Size                 bytes         B         1
 489                                    KB        2^10
 490                                    MB        2^20
 491                                    GB        2^30
 492                                    TB        2^40
 493                                    PB        2^50
 494                                    EB        2^60
 495 
 496 Time                 seconds       s         1
 497                                    Ks        10^3
 498                                    Ms        10^6


 544 
 545 .sp
 546 .LP
 547 In the \fBproject\fR file, the value \fB5G\fR is expanded to \fB5368709120\fR:
 548 .sp
 549 .in +2
 550 .nf
 551 process.max-file-size=(priv,5368709120,deny)
 552 .fi
 553 .in -2
 554 
 555 .sp
 556 .LP
 557 The preceding examples use the scaling factors specified in the table above.
 558 .sp
 559 .LP
 560 Note that unit modifiers (for example, \fB5G\fR) are accepted by the
 561 \fBprctl\fR(1), \fBprojadd\fR(1M), and \fBprojmod\fR(1M) commands. You cannot
 562 use unit modifiers in the project database itself.
 563 .SS "Resource Control Values and Privilege Levels"

 564 .LP
 565 A threshold value on a resource control constitutes a point at which local
 566 actions can be triggered or global actions, such as logging, can occur.
 567 .sp
 568 .LP
 569 Each threshold value on a resource control must be associated with a privilege
 570 level. The privilege level must be one of the following three types:
 571 .sp
 572 .ne 2
 573 .na
 574 \fB\fBbasic\fR\fR
 575 .ad
 576 .sp .6
 577 .RS 4n
 578 Can be modified by the owner of the calling process.
 579 .RE
 580 
 581 .sp
 582 .ne 2
 583 .na


 612 assigned a basic privilege by default.
 613 .sp
 614 .LP
 615 The privilege level for a resource control value is defined in the privilege
 616 field of the resource control block as \fBRCTL_BASIC\fR, \fBRCTL_PRIVILEGED\fR,
 617 or \fBRCTL_SYSTEM\fR. See \fBsetrctl\fR(2) for more information. You can use
 618 the \fBprctl\fR command to modify values that are associated with basic and
 619 privileged levels.
 620 .sp
 621 .LP
 622 In specifying the privilege level of \fBprivileged\fR, you can use the
 623 abbreviation \fBpriv\fR. For example:
 624 .sp
 625 .in +2
 626 .nf
 627 task.max-lwps=(priv,1K,deny)
 628 .fi
 629 .in -2
 630 
 631 .SS "Global and Local Actions on Resource Control Values"

 632 .LP
 633 There are two categories of actions on resource control values: global and
 634 local.
 635 .sp
 636 .LP
 637 Global actions apply to resource control values for every resource control on
 638 the system. You can use \fBrctladm\fR(1M) to perform the following actions:
 639 .RS +4
 640 .TP
 641 .ie t \(bu
 642 .el o
 643 Display the global state of active system resource controls.
 644 .RE
 645 .RS +4
 646 .TP
 647 .ie t \(bu
 648 .el o
 649 Set global logging actions.
 650 .RE
 651 .sp


 837 .sp .6
 838 .RS 4n
 839 Terminate the process. File size limit exceeded. Available only to resource
 840 controls with the \fBRCTL_GLOBAL_FILE_SIZE\fR property
 841 (\fBprocess.max-file-size\fR). See \fBrctlblk_set_value\fR(3C).
 842 .RE
 843 
 844 .sp
 845 .ne 2
 846 .na
 847 \fB\fBSIGXCPU\fR\fR
 848 .ad
 849 .sp .6
 850 .RS 4n
 851 Terminate the process. CPU time limit exceeded. Available only to resource
 852 controls with the \fBRCTL_GLOBAL_CPUTIME\fR property
 853 (\fBprocess.max-cpu-time\fR). See \fBrctlblk_set_value\fR(3C).
 854 .RE
 855 
 856 .SS "Resource Control Flags and Properties"

 857 .LP
 858 Each resource control on the system has a certain set of associated properties.
 859 This set of properties is defined as a set of flags, which are associated with
 860 all controlled instances of that resource. Global flags cannot be modified, but
 861 the flags can be retrieved by using either \fBrctladm\fR(1M) or the
 862 \fBsetrctl\fR(2) system call.
 863 .sp
 864 .LP
 865 Local flags define the default behavior and configuration for a specific
 866 threshold value of that resource control on a specific process or process
 867 collective. The local flags for one threshold value do not affect the behavior
 868 of other defined threshold values for the same resource control. However, the
 869 global flags affect the behavior for every value associated with a particular
 870 control. Local flags can be modified, within the constraints supplied by their
 871 corresponding global flags, by the \fBprctl\fR command or the \fBsetrctl\fR
 872 system call. See \fBsetrctl\fR(2).
 873 .sp
 874 .LP
 875 For the complete list of local flags, global flags, and their definitions, see
 876 \fBrctlblk_set_value\fR(3C).


 941 .sp
 942 .in +2
 943 .nf
 944 $ prctl -n process.max-cpu-time $$
 945     process 353939: -ksh
 946     NAME    PRIVILEGE    VALUE    FLAG   ACTION              RECIPIENT
 947  process.max-cpu-time
 948          privileged   18.4Es    inf   signal=XCPU                 -
 949          system       18.4Es    inf   none
 950 .fi
 951 .in -2
 952 
 953 .sp
 954 .LP
 955 The \fBmax\fR (\fBRCTL_LOCAL_MAXIMAL\fR) flag is set for both threshold values,
 956 and the \fBinf\fR (\fBRCTL_GLOBAL_INFINITE\fR) flag is defined for this
 957 resource control. An \fBinf\fR value has an infinite quantity. The value is
 958 never enforced. Hence, as configured, both threshold quantities represent
 959 infinite values that are never exceeded.
 960 .SS "Resource Control Enforcement"

 961 .LP
 962 More than one resource control can exist on a resource. A resource control can
 963 exist at each containment level in the process model. If resource controls are
 964 active on the same resource at different container levels, the smallest
 965 container's control is enforced first. Thus, action is taken on
 966 \fBprocess.max-cpu-time\fR before \fBtask.max-cpu-time\fR if both controls are
 967 encountered simultaneously.
 968 .SH ATTRIBUTES

 969 .LP
 970 See \fBattributes\fR(5) for a description of the following attributes:
 971 .sp
 972 
 973 .sp
 974 .TS
 975 box;
 976 c | c
 977 l | l .
 978 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 979 _
 980 Interface Stability     Evolving
 981 .TE
 982 
 983 .SH SEE ALSO

 984 .LP
 985 \fBprctl\fR(1), \fBpooladm\fR(1M), \fBpoolcfg\fR(1M), \fBprojadd\fR(1M),
 986 \fBprojmod\fR(1M), \fBrctladm\fR(1M), \fBsetrctl\fR(2),
 987 \fBrctlblk_set_value\fR(3C), \fBlibpool\fR(3LIB), \fBproject\fR(4),
 988 \fBattributes\fR(5), \fBFSS\fR(7)
 989 .sp
 990 .LP
 991 \fISystem Administration Guide:  Virtualization Using the Solaris Operating
 992 System\fR