Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
9.  Fair Share Scheduler FSS and Processor Sets FSS and Processor Sets Examples  Previous   Contents   Next 
   
 

Combining FSS With Other Scheduling Classes

By default, the FSS scheduling class uses the same range of priorities (0 to 59) as the timesharing (TS), interactive (IA), and fixed priority (FX) scheduling classes. Therefore, you should avoid having processes from these scheduling classes share the same processor set. A mix of processes in the FSS, TS, IA, and FX classes could result in unexpected scheduling behavior.

With the use of processor sets, you can mix TS, IA, and FX with FSS in one system. However, all the processes that run on each processor set must be in one scheduling class, so they do not compete for the same CPUs. The FX scheduler in particular should not be used in conjunction with the FSS scheduling class unless processor sets are used. This precaution prevents applications in the FX class from using priorities high enough to starve applications in the FSS class.

You can mix processes in the TS and IA classes in the same processor set, or on the same system without processor sets.

The Solaris operating environment also offers a real-time (RT) scheduler to users with superuser privileges. By default, the RT scheduling class uses system priorities in a different range (usually from 100 to 159) than FSS. Because RT and FSS are using disjoint ranges of priorities, FSS can coexist with the RT scheduling class within the same processor set. However, the FSS scheduling class does not then have any control over processes that run in the RT class.

For example, on a four-processor system, a single-threaded RT process can consume one entire processor if the process is CPU bound. If the system also runs FSS, regular user processes compete for the three remaining CPUs that are not being used by the RT process. Note that the RT process might not use the CPU continuously. When it is idle, FSS utilizes all four processors.

Find out which scheduling classes the processor sets are running in and ensure that each processor set is configured to run either TS, IA, FX, or FSS processes.

$ ps -ef -o pset,class | grep -v CLS | sort | uniq
1 FSS
1 SYS
2 TS
2 RT
3 FX

To set the default scheduler for the system, see "FSS Configuration Examples" and dispadmin(1M). To move running processes into a different scheduling class, see "FSS Configuration Examples" and priocntl(1).

Monitoring the FSS

You can use prstat(1M) to monitor CPU usage by active projects.

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 of time. See Chapter 7, Extended Accounting for more information.

How to Monitor System CPU Usage by Projects

To monitor the CPU usage of projects that run on the system, type the following:

% prstat -J

How to Monitor CPU Usage by Projects in Processor Sets

To monitor the CPU usage of projects on a list of processor sets, type the following:

% prstat -J -C pset-list
pset-list

List of processor set IDs that are separated by commas

FSS Configuration Examples

As in other scheduling classes in the Solaris environment, commands to set the scheduler class, configure the scheduler's tunable parameters, and configure the properties of individual processes can be used with FSS.

How to Set the Scheduler Class

Use the dispadmin command to set FSS as the default scheduler for the system.

# dispadmin -d FSS

This change becomes effective on the next reboot. After reboot, every process on the system runs in the FSS scheduling class.

How to Manually Move Processes From the TS Into the FSS Class

You can manually move processes from the TS scheduling class into the FSS scheduling class without changing the default scheduling class and rebooting.

  1. Become superuser.

  2. Move the init process (pid 1) into the FSS scheduling class.

    # priocntl -s -c FSS -i pid 1
  3. Move all processes from the TS scheduling class into the FSS scheduling class.

    # priocntl -s -c FSS -i class TS

All processes again run in the TS scheduling class after reboot.

How to Manually Move Processes From all User Classes Into the FSS Class

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.

  1. Become superuser.

  2. Move the init process (pid 1) into the FSS scheduling class.

    # priocntl -s -c FSS -i pid 1
  3. Move all processes from their current scheduling classes into the FSS scheduling class.

    # priocntl -s -c FSS -i all

All processes again run in the default scheduling class after reboot.

How to Move a Project's Processes Into the FSS Class

You can manually move processes in a particular project from their current scheduling class to the FSS scheduling class.

  1. Become superuser.

  2. Move processes that run in project ID 10 to the FSS scheduling class.

# priocntl -s -c FSS -i projid 10

The project's processes again run in the default scheduling class after reboot.

How to Tune Scheduler Parameters

You can use the dispadmin command to examine and tune the FSS scheduler's time quantum value. Time quantum is the amount of time that a thread is allowed to run before it must relinquish the processor. To display the current time quantum for the FSS scheduler, type the following:

$ dispadmin -c FSS -g
#
# Fair Share Scheduler Configuration
#
RES=1000
#
# Time Quantum
#
QUANTUM=110

When you use the -g option, you can also use the -r 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. Type the following:

$ dispadmin -c FSS -g -r 100
#
# Fair Share Scheduler Configuration
#
RES=100
#
# Time Quantum
#
QUANTUM=11

To set scheduling parameters for the FSS scheduling class, use dispadmin -s. The values in file must be in the format output by the -g option. These values overwrite the current values in the kernel. Type the following:

$ dispadmin -c FSS -s file

References

For more information on how to use the FSS scheduler, see priocntl(1), ps(1), dispadmin(1M), and FSS(7).

 
 
 
  Previous   Contents   Next