<chapter id="rmfss.task-1"><title>Administering the Fair Share Scheduler (Tasks)</title><highlights><para>This chapter describes how to use the fair share scheduler (FSS).</para><para>For an overview of the FSS, see <olink targetptr="rmfss-1" remap="internal">Chapter&nbsp;8,
Fair Share Scheduler (Overview)</olink>. For information on scheduling class
when zones are in use, see <olink targetptr="gejen" remap="internal">Scheduling Class</olink>.</para>
</highlights><sect1 id="rmfss.task-23"><title>Administering the Fair Share Scheduler (Task
Map)</title><informaltable frame="all"><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="33*"/><colspec colwidth="33*"/><colspec colwidth="33*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Information</para>
</entry>
</row>
</thead><tbody><row><entry><para>Monitor CPU usage.</para>
</entry><entry><para>Monitor the CPU usage of projects, and projects in processor sets.</para>
</entry><entry><para><olink targetptr="rmfss.task-2" remap="internal">Monitoring the FSS</olink></para>
</entry>
</row><row><entry><para>Set the default scheduler class.</para>
</entry><entry><para>Make a scheduler such as the FSS the default scheduler for the system.</para>
</entry><entry><para><olink targetptr="rmfss.task-6" remap="internal">How to Make FSS the Default Scheduler
Class</olink></para>
</entry>
</row><row><entry><para>Move running processes from one scheduler class to a different scheduling
class, such as the FSS class.</para>
</entry><entry><para>Manually move processes from one scheduling class to another scheduling
class without changing the default scheduling class and rebooting.</para>
</entry><entry><para><olink targetptr="rmfss.task-7" remap="internal">How to Manually Move Processes From
the TS Class Into the FSS Class</olink></para>
</entry>
</row><row><entry><para>Move all running processes from all scheduling classes to a different
scheduling class, such as the FSS class.</para>
</entry><entry><para>Manually move processes in all scheduling classes to another scheduling
class without changing the default scheduling class and rebooting.</para>
</entry><entry><para><olink targetptr="rmfss.task-12" remap="internal">How to Manually Move Processes From
All User Classes Into the FSS Class</olink></para>
</entry>
</row><row><entry><para>Move a project's processes into a different scheduling class, such as
the FSS class.</para>
</entry><entry><para>Manually move a project's processes from their current scheduling class
to a different scheduling class.</para>
</entry><entry><para><olink targetptr="rmfss.task-17" remap="internal">How to Manually Move a Project's Processes
Into the FSS Class</olink></para>
</entry>
</row><row><entry><para>Examine and tune FSS parameters.</para>
</entry><entry><para>Tune the scheduler's time quantum value. <emphasis>Time quantum</emphasis> is
the amount of time that a thread is allowed to run before it must relinquish
the processor.</para>
</entry><entry><para><olink targetptr="rmfss.task-21" remap="internal">How to Tune Scheduler Parameters</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="rmfss.task-2"><title>Monitoring the FSS</title><para>You can use the <command>prstat</command> command described in the <olink targetdoc="group-refman" targetptr="prstat-1m" remap="external"><citerefentry><refentrytitle>prstat</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page to monitor CPU usage
by active projects.</para><para>You can use the extended accounting data for tasks to obtain per-project
statistics on the amount of CPU resources that are consumed over longer periods.
See <olink targetptr="rmacct-1" remap="internal">Chapter&nbsp;4, Extended Accounting (Overview)</olink> for
more information.</para><task id="rmfss.task-4"><title>How to Monitor System CPU Usage by Projects</title><procedure remap="single-step"><step id="rmfss.task-step-32"><para>To monitor the CPU usage of projects that
run on the system, use the <command>prstat</command> command with the <option>J</option> option.</para><screen>% <userinput>prstat -J</userinput></screen>
</step>
</procedure>
</task><task id="rmfss.task-3"><title>How to Monitor CPU Usage by Projects in Processor
Sets</title><procedure remap="single-step"><step id="rmfss.task-step-34"><para>To monitor the CPU usage of projects on
a list of processor sets, type:</para><screen>% <userinput>prstat -J -C <replaceable>pset-list</replaceable></userinput></screen><para>where <replaceable>pset-list</replaceable> is a list of processor set
IDs that are separated by commas.</para>
</step>
</procedure>
</task>
</sect1><sect1 id="rmfss.task-5"><title>Configuring the FSS</title><para>The same commands that you use with other scheduling
classes in the Solaris system can be used with FSS. You can set the scheduler
class, configure the scheduler's tunable parameters, and configure the properties
of individual processes.</para><para>Note that you can use <command>svcadm</command> <literal>restart</literal> to
restart the scheduler service. See <olink targetdoc="group-refman" targetptr="svcadm-1m" remap="external"><citerefentry><refentrytitle>svcadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> for more information.</para><task id="rmfss.task-6"><title>How to Make FSS the Default Scheduler
Class</title><tasksummary><para>The FSS must be the default scheduler on your system to have CPU shares
assignment take effect.</para><para>Using a combination of the <command>priocntl</command> and <command>dispadmin</command> commands ensures that the FSS becomes the default scheduler immediately
and also after reboot.</para>
</tasksummary><procedure><step id="rmfss.task-step-25"><para>Become superuser or assume an equivalent
role.</para><para>Roles contain authorizations and privileged commands. For
more information about roles, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="rmfss.task-step-26"><para>Set the default scheduler for the system
to be the FSS.</para><screen># <userinput>dispadmin -d FSS</userinput></screen><para>This change takes effect on the next reboot. After reboot, every process
on the system runs in the FSS scheduling class.</para>
</step><step><para>Make this configuration take effect immediately, without rebooting.</para><screen># <userinput>priocntl -s -c FSS</userinput></screen>
</step>
</procedure>
</task><task id="rmfss.task-7"><title>How to Manually Move Processes From the TS
Class Into the FSS Class</title><tasksummary><para>You can manually move processes from one scheduling class to another
scheduling class without changing the default scheduling class and rebooting.
This procedure shows how to manually move processes from the TS scheduling
class into the FSS scheduling class.</para>
</tasksummary><procedure><step id="rmfss.task-step-9"><para>Become superuser or assume an equivalent
role.</para><para>Roles contain authorizations and privileged commands. For
more information about roles, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="rmfss.task-step-10"><para>Move the <literal>init</literal> process
(pid 1) into the FSS scheduling class.</para><screen># <userinput>priocntl -s -c FSS -i pid 1</userinput></screen>
</step><step id="rmfss.task-step-11"><para>Move all processes from the TS scheduling
class into the FSS scheduling class.</para><screen># <userinput>priocntl -s -c FSS -i class TS</userinput></screen><note><para>All processes again run in the TS scheduling class after reboot.</para>
</note>
</step>
</procedure>
</task><task id="rmfss.task-12"><title>How to Manually Move Processes From All User
Classes Into the FSS Class</title><tasksummary><para>You might be using a default class other than TS. For example, your
system might be running a window environment that uses the IA class by default.
You can manually move all processes into the FSS scheduling class without
changing the default scheduling class and rebooting.</para>
</tasksummary><procedure><step id="rmfss.task-step-14"><para>Become superuser or assume an equivalent
role.</para><para>Roles contain authorizations and privileged commands. For
more information about roles, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="rmfss.task-step-15"><para>Move the <literal>init</literal> process
(pid 1) into the FSS scheduling class.</para><screen># <userinput>priocntl -s -c FSS -i pid 1</userinput></screen>
</step><step id="rmfss.task-step-16"><para>Move all processes from their current
scheduling classes into the FSS scheduling class.</para><screen># <userinput>priocntl -s -c FSS -i all</userinput></screen><note><para>All processes again run in the default scheduling class after
reboot.</para>
</note>
</step>
</procedure>
</task><task id="rmfss.task-17"><title>How to Manually Move a Project's Processes
Into the FSS Class</title><tasksummary><para>You can manually move a project's processes from their current scheduling
class to the FSS scheduling class.</para>
</tasksummary><procedure><step id="rmfss.task-step-19"><para>Become superuser or assume an equivalent
role.</para><para>Roles contain authorizations and privileged commands. For
more information about roles, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="rmfss.task-step-20"><para>Move processes that run in project ID <replaceable>10</replaceable> to the FSS scheduling class.</para><screen># <userinput>priocntl -s -c FSS -i projid <replaceable>10</replaceable></userinput></screen><para>The project's processes again run in the default scheduling class after
reboot.</para>
</step>
</procedure>
</task><sect2 id="rmfss.task-21"><title>How to Tune Scheduler Parameters</title><para>You can use the <command>dispadmin</command> command to display or change
process scheduler parameters while the system is running. For example, you
can use <command>dispadmin</command> to examine and tune the FSS scheduler's
time quantum value. <emphasis>Time quantum</emphasis> is the amount of time
that a thread is allowed to run before it must relinquish the processor.</para><para>To display the current time quantum for the FSS scheduler while the
system is running, type:</para><screen>$ <userinput>dispadmin -c FSS -g</userinput>
#
# Fair Share Scheduler Configuration
#
RES=1000
#
# Time Quantum
#
QUANTUM=110</screen><para>When you use the <option>g</option> option, you can also use the <option>r</option> option
to specify the resolution that is used for printing time quantum values. If
no resolution is specified, time quantum values are displayed in milliseconds
by default.</para><screen>$ <userinput>dispadmin -c FSS -g -r 100</userinput>
#
# Fair Share Scheduler Configuration
#
RES=100
#
# Time Quantum
#
QUANTUM=11</screen><para>To set scheduling parameters for the FSS scheduling class, use <command>dispadmin</command> <option>s</option>. The values in <replaceable>file</replaceable> must
be in the format output by the <option>g</option> option. These values overwrite
the current values in the kernel. Type the following:</para><screen>$ <userinput>dispadmin -c FSS -s <replaceable>file</replaceable></userinput></screen>
</sect2>
</sect1>
</chapter>