class_admin(8)class_admin(8)NAMEclass_admin - Administer daemons and databases for class scheduling.
/usr/sbin/class_admin [subcommand[, subcommand]...]
Class scheduling allows you to organize users and groups into classes
and specify the maximum percentage of CPU usage permitted each class.
The class_admin utility is used to set up and maintain class databases
and to start and stop the class scheduler. These operations are per‐
formed through utility subcommands, which are listed and described in
the “Subcommands” section. Read the information in class_scheduling(4)
if you are unfamiliar with class scheduling. That reference page
includes conceptual information, guidelines, and restrictions that are
not repeated here and apply to both the class_admin utility and the
class scheduling APIs.
All class_admin subcommands execute in the context of a soft partition
(processor set). The class_admin utility maintains different class
scheduling databases for different partitions, and you must enable
class scheduling on each partition for which you maintain a class
scheduling database. If user-defined partitions do not exist, the
default partition is the only partition on the system and contains all
system CPUs. This partition exists even after user-defined partitions
have been created; in which case, it contains all CPUs that have not
been allocated to a user-defined partition. When you enter the
class_admin command without a setp pset_num subcommand, the default
partition is your context. You can enter a setp subcommand at the util‐
ity prompt to change partition context.
The class_admin command can be run interactively or non-interactively.
Non-interactive mode allows class_admin to be run from within a script,
which makes it easy to enable class scheduling at system startup
through use of an init script. (See init(8).) To run class_admin non-
interactively, specify one or more subcommands as arguments on the
utility command line.
Interactive mode is useful after system startup. To run class_admin
interactively, you can invoke class_admin without specifying any argu‐
ments, and then enter all subcommands at the utility prompt. The
exception is that you should include the setp pset_num subcommand at
invocation time if you do not plan to enable class scheduling for the
system default partition.
Database Configuration Parameters
If a class scheduling database does not exist for the partition to
which context is set, the class_admin utility automatically creates a
class database when it starts up. When running the utility interac‐
tively, you supply configuration parameters for the database by answer‐
ing three questions. For non-interactive operation, the utility auto‐
matically applies to the database the default answers to these ques‐
tions. You can reset configuration parameters at a later time by using
the utility's configure subcommand.
The following questions prompt for database configuration parameters:
Shall processes that have not been explicitly assigned to a defined
class be assigned to a “default” class? Enter (yes/no) [no]:
To be class scheduled, a process must be assigned to a class. If
you answer yes to this question, a special class called the
“default” class will be created, and any process that does not
belong to the classes you define will be assigned to this class.
If you answer no to this question, then only those processes
that belong to classes defined by you are class scheduled. Pro‐
cesses owned by root (UID 0) are not subject to class schedul‐
ing. Enforce class scheduling when the CPU is otherwise idle?
If you answer no to this question, the scheduler can allow a
class to exceed its CPU percentage when the partition has idle
CPUs. Otherwise, a class is held to its allotted percentage even
if the CPUs in the partition have no other work. How often do
you want the system to reset class usage? Enter number of sec‐
If there are interactive jobs subject to class scheduling, use a
small number (no more than several seconds) to ensure a quick
response time. If only batch jobs are class scheduled, you can
enter larger values because system response time is not an
If you included the enable subcommand on the class_admin command line,
your settings take effect immediately.
Add one or more identifiers for a group, user, process, process group,
or session to an existing scheduling class. If the specified identifier
is a member of another class, you will be asked whether you want to
move the member.
Syntax: add class_name type id [id]...
The type argument can be one of the following: To add one or
more group identifiers to the class. In this case, the specified
numbers reside in the /etc/group file. These identifiers will
persist in the class scheduling database across reboots. To add
one or more user identifiers to the class. In this case, the
specified numbers reside in the /etc/passwd file. These identi‐
fiers will persist in the class scheduling database across
reboots. To add one or more process identifiers to the class.
In this case, the specified numbers, as shown in the PID column
of the ps command display, persist in the class scheduling data‐
base only as long as those processes are running. To add one or
more process group identifiers to the class. In this case, the
specified numbers, as shown in the PGID column of the ps command
display, persist in the class scheduling database only as long
as any processes in those process groups are running. To add
one or more session identifiers to the class. In this case, the
specified numbers, as shown in the SESS column of the ps command
display, persist in the class scheduling database only as long
as any processes in those sessions are running. Remove recent
changes to the currently loaded database and go back to the ver‐
sion last saved to disk.
Syntax: cancel Change the CPU percentage allotted to a schedul‐
ing class. You cannot specify a CPU percentage that would cause
the total of percentages for all classes in the database to
Syntax: change class_name cpu_percentage Create a new scheduling
class. The specified name must be unique and cannot exceed 20
characters. Because a newly created class will be empty, you
must use the add subcommand to populate the class with members
or add process members indirectly through the runclass command
after class scheduling is enabled. You cannot specify a CPU per‐
centage that would cause the total of percentages for all
classes in the database to exceed 100%.
Syntax: create class_name cpu_percentage Set up the basic class
scheduling parameters. You will be asked the three questions
discussed in the “Database Configuration Parameters” section.
Syntax: configure Remove one or more member identifiers from an
existing scheduling class.
Syntax: delete class_name type id [id]...
See the entry for the add subcommand for a list of supported
type values. Destroy an existing scheduling class. If the
class is not empty, you will be asked for permission to destroy
Syntax: destroy class_name Turn off class scheduling for the
partition to which context is set. Note that the kernel will
terminate the instance of the scheduler daemon for that parti‐
Syntax: disable Turn on class scheduling for the partition to
which context is set. This starts a daemon that periodically
examines CPU usage by different classes and makes adjustments in
CPU access according to the class limits.
Syntax: enable Return to the command shell. If there are any
unsaved changes to the current class scheduling database during
your session, you will be asked whether you want to save them.
(Same as for quit.)
Syntax: exit Display online help. If you specify a particular
subcommand, the utility displays the syntax for only that sub‐
command. Otherwise, the utility displays a list of all subcom‐
mands and their arguments.
Syntax: help [subcommand] List all partitons and the status of
class scheduling for each.
Syntax: listp Load the specified class database from disk into
Syntax: load database_path
The database_path is the path to the class database. By default,
class databases reside in the /etc/class directory and have file
names in the format part.partition.
If you made changes to the database that is currently loaded
into memory and neither cancelled nor saved these changes to
disk, the utility tells you that load operation will destroy
unsaved changes and asks if you still want to proceed with the
load operation. Return to the command shell. If there are any
unsaved changes to the database that is currently loaded into
memory, you will be asked whether you want to save them. (Same
as for exit.)
Syntax: quit Change the name of an scheduling class.
Syntax: rename old_class_name new_class_name Write permanent
database changes to a file on disk and continue.
Syntax: save [database_path]
The database_path argument is the pathname for the class data‐
base that you are currently setting up or changing. If you omit
this argument, changes are saved to the disk file of the class
database currently loaded into memory. If you invoked
class_admin to set up a new database, use the show command to
see the default name and directory for the associated file. If
you decide to change the default name or location, remember that
the pathname cannot exceed 80 characters. Set partition con‐
Syntax: setp [pset_id]
If you do not specify pset_id, the system default partition
(processor set 0) is assumed. See also listp. Show the CPU per‐
centage and members for a scheduling class. If you do not spec‐
ify a class name, the utility shows this information for all
classes in the currently loaded database.
Syntax: show [class_name] List the target and actual CPU uti‐
lization for a scheduling class. If you do not specify a class
name, the utility shows CPU utilization for all classes in the
Syntax: stats [class_name]
Default pathname for a class database, where * represents the parti‐
tion. The class scheduler daemon.
Commands: ps(1), runclass(1)
Files: class_scheduling(4), processor_sets(4)
Functions: class_add(3), class_change(3), class_change_name(3),
class_close(3), class_configure(3), class_create(3), class_data‐
base_file_exists(3), class_database_modified(3), class_data‐
base_name(3), class_delete(3), class_destroy(3), class_disable(3),
class_get_class_members(3), class_get_classes(3), class_get_con‐
fig_stats(3), class_load_database(3), class_open(3),