summaryrefslogtreecommitdiff
path: root/usr/src/man/man7/resource_controls.7
blob: 34392538bc20c8c03ab359781127d53949c9962b (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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
'\" te
.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
.\" Copyright 2017, Joyent, Inc.
.\" Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
.\" 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.
.\" 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.
.\" 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]
.TH RESOURCE_CONTROLS 7 "Jan 23, 2021"
.SH NAME
resource_controls \- resource controls available through projects and zones
.SH DESCRIPTION
The resource controls facility is configured through the project database. See
\fBproject\fR(5). You can set and modify resource controls through the
following utilities:
.RS +4
.TP
.ie t \(bu
.el o
.BR prctl (1)
.RE
.RS +4
.TP
.ie t \(bu
.el o
.BR projadd (8)
.RE
.RS +4
.TP
.ie t \(bu
.el o
.BR projmod (8)
.RE
.RS +4
.TP
.ie t \(bu
.el o
.BR rctladm (8)
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fBzonecfg\fR(8)
.RE
.sp
.LP
In a program, you use \fBsetrctl\fR(2) to set resource control values.
.sp
.LP
In addition to the preceding resource controls, there are resource pools,
accessible through the \fBpooladm\fR(8) and \fBpoolcfg\fR(8) utilities. In a
program, resource pools can be manipulated through the \fBlibpool\fR(3LIB)
library.
.sp
.LP
The following are the resource controls are available:
.sp
.ne 2
.na
\fBprocess.max-address-space\fR
.ad
.sp .6
.RS 4n
Maximum amount of address space, as summed over segment sizes, that is
available to this process, expressed as a number of bytes.
.RE

.sp
.ne 2
.na
\fBprocess.max-core-size\fR
.ad
.sp .6
.RS 4n
Maximum size of a core file created by this process, expressed as a number of
bytes.
.RE

.sp
.ne 2
.na
\fBprocess.max-cpu-time\fR
.ad
.sp .6
.RS 4n
Maximum CPU time that is available to this process, expressed as a number of
seconds.
.RE

.sp
.ne 2
.na
\fBprocess.max-data-size\fR
.ad
.sp .6
.RS 4n
Maximum heap memory available to this process, expressed as a number of bytes.
.RE

.sp
.ne 2
.na
\fBprocess.max-file-descriptor\fR
.ad
.sp .6
.RS 4n
Maximum file descriptor index available to this process, expressed as an
integer.
.RE

.sp
.ne 2
.na
\fBprocess.max-file-size\fR
.ad
.sp .6
.RS 4n
Maximum file offset available for writing by this process, expressed as a
number of bytes.
.RE

.sp
.ne 2
.na
\fBprocess.max-locked-memory\fR
.ad
.sp .6
.RS 4n
Total amount of physical memory that can be locked by this process, expressed
as a number of bytes. This limit is not enforced for a process with the
\fBPRIV_PROC_LOCK_MEMORY\fR privilege. Because the ability to lock memory
is controlled by the \fBPRIV_PROC_LOCK_MEMORY\fR privilege within native
zones, this resource control is only useful within branded zones which might
support a different policy for locking memory.
.RE

.sp
.ne 2
.na
\fBprocess.max-msg-messages\fR
.ad
.sp .6
.RS 4n
Maximum number of messages on a message queue (value copied from the resource
control at \fBmsgget()\fR time), expressed as an integer.
.RE

.sp
.ne 2
.na
\fBprocess.max-msg-qbytes\fR
.ad
.sp .6
.RS 4n
Maximum number of bytes of messages on a message queue (value copied from the
resource control at \fBmsgget()\fR time), expressed as a number of bytes.
.RE

.sp
.ne 2
.na
\fBprocess.max-port-events\fR
.ad
.sp .6
.RS 4n
Maximum allowable number of events per event port, expressed as an integer.
.RE

.sp
.ne 2
.na
\fBprocess.max-sem-nsems\fR
.ad
.sp .6
.RS 4n
Maximum number of semaphores allowed per semaphore set, expressed as an
integer.
.RE

.sp
.ne 2
.na
\fBprocess.max-sem-ops\fR
.ad
.sp .6
.RS 4n
Maximum number of semaphore operations allowed per \fBsemop\fR call (value
copied from the resource control at \fBsemget()\fR time). Expressed as an
integer, specifying the number of operations.
.RE

.sp
.ne 2
.na
\fBprocess.max-sigqueue-size\fR
.ad
.sp .6
.RS 4n
Maximum number of outstanding queued signals.
.RE

.sp
.ne 2
.na
\fBprocess.max-stack-size\fR
.ad
.sp .6
.RS 4n
Maximum stack memory segment available to this process, expressed as a number
of bytes.
.RE

.sp
.ne 2
.na
\fBproject.cpu-cap\fR
.ad
.sp .6
.RS 4n
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 \fBsyslog\fR
action.
.RE

.sp
.ne 2
.na
\fBproject.cpu-shares\fR
.ad
.sp .6
.RS 4n
Number of CPU shares granted to a project for use with the fair share scheduler
(see \fBFSS\fR(4)). The unit used is the number of shares (an integer). This
resource control does not support the \fBsyslog\fR action.
.RE

.sp
.ne 2
.na
\fBproject.max-contracts\fR
.ad
.sp .6
.RS 4n
Maximum number of contracts allowed in a project, expressed as an integer.
.RE

.sp
.ne 2
.na
\fBproject.max-crypto-memory\fR
.ad
.sp .6
.RS 4n
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.
.RE

.sp
.ne 2
.na
\fBproject.max-locked-memory\fR
.ad
.sp .6
.RS 4n
Total amount of physical memory locked by device drivers and user processes
(including D/ISM), expressed as a number of bytes.
.RE

.sp
.ne 2
.na
\fBproject.max-lwps\fR
.ad
.sp .6
.RS 4n
Maximum number of LWPs simultaneously available to a project, expressed as an
integer.
.RE

.sp
.ne 2
.na
\fBproject.max-msg-ids\fR
.ad
.sp .6
.RS 4n
Maximum number of message queue IDs allowed for a project, expressed as an
integer.
.RE

.sp
.ne 2
.na
\fBproject.max-processes\fR
.ad
.sp .6
.RS 4n
Maximum number of processes simultaneously available to a project, expressed as
an integer.
.RE

.sp
.ne 2
.na
\fBproject.max-port-ids\fR
.ad
.sp .6
.RS 4n
Maximum allowable number of event ports, expressed as an integer.
.RE

.sp
.ne 2
.na
\fBproject.max-sem-ids\fR
.ad
.sp .6
.RS 4n
Maximum number of semaphore IDs allowed for a project, expressed as an integer.
.RE

.sp
.ne 2
.na
\fBproject.max-shm-ids\fR
.ad
.sp .6
.RS 4n
Maximum number of shared memory IDs allowed for a project, expressed as an
integer.
.RE

.sp
.ne 2
.na
\fBproject.max-shm-memory\fR
.ad
.sp .6
.RS 4n
Total amount of shared memory allowed for a project, expressed as a number of
bytes.
.RE

.sp
.ne 2
.na
\fBproject.max-tasks\fR
.ad
.sp .6
.RS 4n
Maximum number of tasks allowable in a project, expressed as an integer.
.RE

.sp
.ne 2
.na
\fBproject.pool\fR
.ad
.sp .6
.RS 4n
Binds a specified resource pool with a project.
.RE

.sp
.ne 2
.na
\fBrcap.max-rss\fR
.ad
.sp .6
.RS 4n
The total amount of physical memory, in bytes, that is available to processes
in a project.
.RE

.sp
.ne 2
.na
\fBtask.max-cpu-time\fR
.ad
.sp .6
.RS 4n
Maximum CPU time that is available to this task's processes, expressed as a
number of seconds.
.RE

.sp
.ne 2
.na
\fBtask.max-lwps\fR
.ad
.sp .6
.RS 4n
Maximum number of LWPs simultaneously available to this task's processes,
expressed as an integer.
.RE

.sp
.ne 2
.na
\fBtask.max-processes\fR
.ad
.sp .6
.RS 4n
Maximum number of processes simultaneously available to this task,
expressed as an integer.
.RE

.sp
.LP
The following zone-wide resource controls are available:
.sp
.ne 2
.na
\fBzone.cpu-baseline\fR
.ad
.sp .6
.RS 4n
Sets a baseline amount of CPU time that a zone can use before it is considered
to be bursting. The unit used is the percentage of a single CPU that is being
used by all user threads in a zone. The value should be less than the
\fBzone.cpu-cap\fR rctl value and is expressed as an integer.
This resource control does not support the \fBsyslog\fR action.
.RE

.sp
.ne 2
.na
\fBzone.cpu-burst-time\fR
.ad
.sp .6
.RS 4n
Sets the number of seconds that a zone can exceed the \fBzone.cpu-baseline\fR
rctl value before being cpu-capped down to the \fBzone.cpu-baseline\fR.
A value of 0 means that \fBzone.cpu-baseline\fR can be exceeded indefinitely.
This resource control does not support the \fBsyslog\fR action.
.RE

.sp
.ne 2
.na
\fBzone.cpu-cap\fR
.ad
.sp .6
.RS 4n
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 \fBsyslog\fR action.
.RE

.sp
.ne 2
.na
\fBzone.cpu-shares\fR
.ad
.sp .6
.RS 4n
Sets a value 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 \fBproject.cpu-shares\fR entries.
Expressed as an integer. This resource control does not support the
\fBsyslog\fR action.
.RE

.sp
.ne 2
.na
\fBzone.max-locked-memory\fR
.ad
.sp .6
.RS 4n
Total amount of physical locked memory available to a zone.
.RE

.sp
.ne 2
.na
\fBzone.max-lofi\fR
.ad
.sp .6
.RS 4n
Sets a limit on the number of \fBLOFI\fR(4D) devices that can be created in a
zone. Expressed as an integer. This resource control does not support the
\fBsyslog\fR action.
.RE

\fBzone.max-lwps\fR
.ad
.sp .6
.RS 4n
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 by using \fBproject.max-lwps\fR entries. Expressed as
an integer.
.RE

.sp
.ne 2
.na
\fBzone.max-msg-ids\fR
.ad
.sp .6
.RS 4n
Maximum number of message queue IDs allowed for a zone, expressed as an
integer.
.RE

.sp
.ne 2
.na
\fBzone.max-physical-memory\fR
.ad
.sp .6
.RS 4n
Sets a limit on the amount of physical memory (RSS) that can be used by a zone
before resident pages start being forcibly paged out.  The unit used is bytes.
Expressed as an integer.  This resource control does not support the
\fBsyslog\fR action.
\fBzone.max-processes\fR
.ad
.sp .6
.RS 4n
Enhances resource isolation by preventing too many processes in one zone from
affecting other zones. A zone's total processes can be further subdivided among
projects within the zone by using \fBproject.max-processes\fR entries.
Expressed as an integer.
.RE

.sp
.ne 2
.na
.RE

.sp
.ne 2
.na
\fBzone.max-sem-ids\fR
.ad
.sp .6
.RS 4n
Maximum number of semaphore IDs allowed for a zone, expressed as an integer.
.RE

.sp
.ne 2
.na
\fBzone.max-shm-ids\fR
.ad
.sp .6
.RS 4n
Maximum number of shared memory IDs allowed for a zone, expressed as an
integer.
.RE

.sp
.ne 2
.na
\fBzone.max-shm-memory\fR
.ad
.sp .6
.RS 4n
Total amount of shared memory allowed for a zone, expressed as a number of
bytes.
.RE

.sp
.ne 2
.na
\fBzone.max-swap\fR
.ad
.sp .6
.RS 4n
Total amount of swap that can be consumed by user process address space
mappings and \fBtmpfs\fR mounts for this zone.
.RE

.sp
.ne 2
.na
\fB\fBzone.zfs-io-priority\fR\fR
.ad
.sp .6
.RS 4n
Sets a value for the \fBzfs\fR(8) I/O priority for a zone. This is used as
one of the inputs to determine if a zone's I/O should be throttled.  Expressed
as an integer. This resource control does not support the \fBsyslog\fR action.
.RE

.sp
.LP
See \fBzones\fR(7).
.SS "Units Used in Resource Controls"
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.
.sp
.in +2
.nf
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
.fi
.in -2

.sp
.LP
Scaled values can be used with resource controls. The following example shows a
scaled threshold value:
.sp
.in +2
.nf
task.max-lwps=(priv,1K,deny)
.fi
.in -2

.sp
.LP
In the \fBproject\fR file, the value \fB1K\fR is expanded to \fB1000\fR:
.sp
.in +2
.nf
task.max-lwps=(priv,1000,deny)
.fi
.in -2

.sp
.LP
A second example uses a larger scaled value:
.sp
.in +2
.nf
process.max-file-size=(priv,5G,deny)
.fi
.in -2

.sp
.LP
In the \fBproject\fR file, the value \fB5G\fR is expanded to \fB5368709120\fR:
.sp
.in +2
.nf
process.max-file-size=(priv,5368709120,deny)
.fi
.in -2

.sp
.LP
The preceding examples use the scaling factors specified in the table above.
.sp
.LP
Note that unit modifiers (for example, \fB5G\fR) are accepted by the
\fBprctl\fR(1), \fBprojadd\fR(8), and \fBprojmod\fR(8) commands. You cannot
use unit modifiers in the project database itself.
.SS "Resource Control Values and Privilege Levels"
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.
.sp
.LP
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:
.sp
.ne 2
.na
\fBbasic\fR
.ad
.sp .6
.RS 4n
Can be modified by the owner of the calling process.
.RE

.sp
.ne 2
.na
\fBprivileged\fR
.ad
.sp .6
.RS 4n
Can be modified by the current process (requiring \fBsys_resource\fR privilege)
or by \fBprctl\fR(1) (requiring \fBproc_owner\fR privilege).
.RE

.sp
.ne 2
.na
\fBsystem\fR
.ad
.sp .6
.RS 4n
Fixed for the duration of the operating system instance.
.RE

.sp
.LP
A resource control is guaranteed to have one \fBsystem\fR value, which is
defined by the system, or resource provider. The \fBsystem\fR value represents
how much of the resource the current implementation of the operating system is
capable of providing.
.sp
.LP
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.
.sp
.LP
The privilege level for a resource control value is defined in the privilege
field of the resource control block as \fBRCTL_BASIC\fR, \fBRCTL_PRIVILEGED\fR,
or \fBRCTL_SYSTEM\fR. See \fBsetrctl\fR(2) for more information. You can use
the \fBprctl\fR command to modify values that are associated with basic and
privileged levels.
.sp
.LP
In specifying the privilege level of \fBprivileged\fR, you can use the
abbreviation \fBpriv\fR. For example:
.sp
.in +2
.nf
task.max-lwps=(priv,1K,deny)
.fi
.in -2

.SS "Global and Local Actions on Resource Control Values"
There are two categories of actions on resource control values: global and
local.
.sp
.LP
Global actions apply to resource control values for every resource control on
the system. You can use \fBrctladm\fR(8) to perform the following actions:
.RS +4
.TP
.ie t \(bu
.el o
Display the global state of active system resource controls.
.RE
.RS +4
.TP
.ie t \(bu
.el o
Set global logging actions.
.RE
.sp
.LP
You can disable or enable the global logging action on resource controls. You
can set the \fBsyslog\fR action to a specific degree by assigning a severity
level, \fBsyslog=\fR\fIlevel\fR. The possible settings for \fIlevel\fR are as
follows:
.RS +4
.TP
.ie t \(bu
.el o
\fBdebug\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fBinfo\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fBnotice\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fBwarning\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fBerr\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fBcrit\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fBalert\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fBemerg\fR
.RE
.sp
.LP
By default, there is no global logging of resource control violations.
.sp
.LP
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:
\fBnone\fR, \fBdeny\fR, and \fBsignal=\fR. These three actions are used as
follows:
.sp
.ne 2
.na
\fBnone\fR
.ad
.sp .6
.RS 4n
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 threshold is not affected.
.RE

.sp
.ne 2
.na
\fBdeny\fR
.ad
.sp .6
.RS 4n
You can deny resource requests for an amount that is greater than the
threshold. For example, a \fBtask.max-lwps\fR resource control with action deny
causes a \fBfork()\fR system call to fail if the new process would exceed the
control value. See the \fBfork\fR(2).
.RE

.sp
.ne 2
.na
\fBsignal=\fR
.ad
.sp .6
.RS 4n
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.
.RE

.sp
.LP
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
\fBproject.cpu-shares\fR resource control.
.sp
.LP
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 \fBrctladm\fR(8).) A list of available signal actions is presented in the
following list. For additional information about signals, see
\fBsignal\fR(3HEAD).
.sp
.LP
The following are the signals available to resource control values:
.sp
.ne 2
.na
\fBSIGABRT\fR
.ad
.sp .6
.RS 4n
Terminate the process.
.RE

.sp
.ne 2
.na
\fBSIGHUP\fR
.ad
.sp .6
.RS 4n
Send a hangup signal. Occurs when carrier drops on an open line. Signal sent to
the process group that controls the terminal.
.RE

.sp
.ne 2
.na
\fBSIGTERM\fR
.ad
.sp .6
.RS 4n
Terminate the process. Termination signal sent by software.
.RE

.sp
.ne 2
.na
\fBSIGKILL\fR
.ad
.sp .6
.RS 4n
Terminate the process and kill the program.
.RE

.sp
.ne 2
.na
\fBSIGSTOP\fR
.ad
.sp .6
.RS 4n
Stop the process. Job control signal.
.RE

.sp
.ne 2
.na
\fBSIGXRES\fR
.ad
.sp .6
.RS 4n
Resource control limit exceeded. Generated by resource control facility.
.RE

.sp
.ne 2
.na
\fBSIGXFSZ\fR
.ad
.sp .6
.RS 4n
Terminate the process. File size limit exceeded. Available only to resource
controls with the \fBRCTL_GLOBAL_FILE_SIZE\fR property
(\fBprocess.max-file-size\fR). See \fBrctlblk_set_value\fR(3C).
.RE

.sp
.ne 2
.na
\fBSIGXCPU\fR
.ad
.sp .6
.RS 4n
Terminate the process. CPU time limit exceeded. Available only to resource
controls with the \fBRCTL_GLOBAL_CPUTIME\fR property
(\fBprocess.max-cpu-time\fR). See \fBrctlblk_set_value\fR(3C).
.RE

.SS "Resource Control Flags and Properties"
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 \fBrctladm\fR(8) or the
\fBsetrctl\fR(2) system call.
.sp
.LP
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 \fBprctl\fR command or the \fBsetrctl\fR
system call. See \fBsetrctl\fR(2).
.sp
.LP
For the complete list of local flags, global flags, and their definitions, see
\fBrctlblk_set_value\fR(3C).
.sp
.LP
To determine system behavior when a threshold value for a particular resource
control is reached, use \fBrctladm\fR to display the global flags for the
resource control . For example, to display the values for
\fBprocess.max-cpu-time\fR, enter:
.sp
.in +2
.nf
$ rctladm process.max-cpu-time
process.max-cpu-time  syslog=off [ lowerable no-deny cpu-time inf seconds ]
.fi
.in -2

.sp
.LP
The global flags indicate the following:
.sp
.ne 2
.na
\fBlowerable\fR
.ad
.sp .6
.RS 4n
Superuser privileges are not required to lower the privileged values for this
control.
.RE

.sp
.ne 2
.na
\fBno-deny\fR
.ad
.sp .6
.RS 4n
Even when threshold values are exceeded, access to the resource is never
denied.
.RE

.sp
.ne 2
.na
\fBcpu-time\fR
.ad
.sp .6
.RS 4n
\fBSIGXCPU\fR is available to be sent when threshold values of this resource
are reached.
.RE

.sp
.ne 2
.na
\fBseconds\fR
.ad
.sp .6
.RS 4n
The time value for the resource control.
.RE

.sp
.LP
Use the \fBprctl\fR command to display local values and actions for the
resource control. For example:
.sp
.in +2
.nf
$ 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
.fi
.in -2

.sp
.LP
The \fBmax\fR (\fBRCTL_LOCAL_MAXIMAL\fR) flag is set for both threshold values,
and the \fBinf\fR (\fBRCTL_GLOBAL_INFINITE\fR) flag is defined for this
resource control. An \fBinf\fR value has an infinite quantity. The value is
never enforced. Hence, as configured, both threshold quantities represent
infinite values that are never exceeded.
.SS "Resource Control Enforcement"
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
\fBprocess.max-cpu-time\fR before \fBtask.max-cpu-time\fR if both controls are
encountered simultaneously.
.SH ATTRIBUTES
See \fBattributes\fR(7) for a description of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Evolving
.TE

.SH SEE ALSO
.BR prctl (1),
.BR setrctl (2),
.BR rctlblk_set_value (3C),
.BR libpool (3LIB),
.BR FSS (4),
.BR project (5),
.BR attributes (7),
.BR privileges (7),
.BR zones (7),
.BR pooladm (8),
.BR poolcfg (8),
.BR projadd (8),
.BR projmod (8),
.BR rctladm (8)
.sp
.LP
\fISystem Administration Guide:  Virtualization Using the Solaris Operating
System\fR