Sol One Resource Management Guide: Projects, Controls, FSS and Pools Explained

A practical Sol One resource management guide for Solaris 10: projects, resource controls, fair share scheduler, memory caps and pools, with commands.

One runaway process can slow every application on a shared server. Solaris resource management exists to stop that from happening. This Sol One resource management guide walks through the core tools in Solaris 10 and shows how to use them without guesswork.

A note on scope: "Sol One" is not an official product name, so this guide treats it as shorthand for the Solaris 10 resource management framework. Everything below is based on Oracle's Solaris 10 documentation. Commands and defaults may differ on other releases, so check your own system's man pages.

What Resource Management Does and When to Use It

By default, Solaris gives all activity roughly equal access to system resources. That works until a heavy batch job, a leaky application, or a noisy neighbor starts hurting everything else. Resource management lets you treat each workload separately, where a workload means all the processes of an application or group of applications.

According to the official Solaris 10 documentation, you can restrict access to a specific resource, give preferred workloads priority, and isolate workloads from each other. You can also record usage for analysis, billing, and capacity planning.

Good use cases include:

  • Consolidating several applications onto one larger server
  • Hosting multiple web sites on one machine and protecting each from the others
  • Stopping a faulty CGI script from consuming all CPU
  • Preventing an application from leaking all available virtual memory
  • Giving time-sensitive users, such as traders running queries, more processing power than steady background users

A useful rule of thumb from this Sol One resource management guide: do not configure anything until you know which workloads compete and which do not.

The Three Control Mechanisms

Solaris offers three ways to control resources. Each has a different trade-off.

MechanismWhat it doesMain featureTrade-off
ConstraintsSets hard bounds on consumptionResource controls (rctls)Can break applications if set too tight
SchedulingAllocates by a predictable algorithm at intervalsFair share scheduler (FSS)Only matters when there is contention
PartitioningBinds a workload to a subset of resourcesResource pools and processor setsReserved CPUs sit idle if the workload is idle

The documentation suggests narrowing constraints gradually for applications whose resource behavior is unknown. That is sound advice in practice too.

Step One: Label Workloads With Projects and Tasks

Everything else in this Sol One resource management guide depends on projects and tasks. A project is a label for a workload. A task is a group of processes that represents a unit of work within a project. Each process belongs to one task, and each task belongs to one project.

How Users Land in a Project

Every user needs a default project to log in. Solaris checks these in order:

  1. A project attribute in the user's /etc/user_attr entry
  2. A project named user. followed by the user ID
  3. A project named group. followed by the user's default group
  4. The special project named default

If none match, the login is denied. Project data can live in /etc/project, an NIS map, or LDAP, depending on your nsswitch.conf setting.

Core Project Commands

TaskCommand
Add a project for user mark with ID 4113projadd -U mark -p 4113 booksite
Add a comment to a projectprojmod -c 'Book Auction Project' booksite
List projects verboselyprojects -l
Delete a projectprojdel booksite
Check file syntaxprojmod -n
Show current projectid -p
Start a new task in a projectnewtask -v -p booksite
Move a running process into a new tasknewtask -v -p booksite -c PID

One gotcha worth remembering: edits to the project database do not affect tasks that are already running. They apply to new tasks that join the project through login or newtask.

Step Two: Measure Before You Limit

The documentation is clear that you should characterize demand before applying controls. Two sets of tools help.

For real-time views, prstat -J summarizes usage by project, and prstat -T does so by task. The classic tools vmstat, iostat, mpstat, and sar fill in the rest.

For history, turn on extended accounting. It writes usage records per process, task, or network flow, so you can plan capacity or build chargeback reports. Records for a task are written at completion, and interim records are possible too.

Typical activation commands from the official guide:

  • Processes: acctadm -e extended -f /var/adm/exacct/proc process
  • Tasks: acctadm -e extended,mstate -f /var/adm/exacct/task task
  • Flows: acctadm -e extended -f /var/adm/exacct/flow flow

Run acctadm with no arguments to see status. To keep accounting active across reboots, you must activate it manually at least once and link the startup script into /etc/rc2.d.

Step Three: Set Boundaries With Resource Controls

Resource controls extend the old per-process rlimit idea to tasks, projects, and zones. Names carry a prefix such as process., task., project., or zone..

Common Controls

ControlWhat it limitsUnit
project.cpu-sharesCPU shares for the fair share schedulerShares
project.cpu-capAbsolute CPU use (100 equals one full CPU)CPUs
project.max-lwpsLightweight processes in a projectCount
task.max-lwpsLightweight processes per taskCount
process.max-file-descriptorHighest file descriptor indexIndex
project.max-shm-memorySystem V shared memoryBytes
process.max-cpu-timeCPU time per processSeconds

Anatomy of a Control Value

Each value has three parts: a privilege level, a threshold, and an action. Privilege levels are basic (owner can change), privileged (superuser only), and system (fixed). Actions are none, deny, or signal=.

Example: task.max-lwps=(privileged,10,deny) means a task cannot create more than 10 LWPs, and further requests fail. In the documentation's walkthrough with a limit of 3, a fourth shell launch fails with a vfork error.

The none action is handy for monitoring. Combine it with rctladm -e syslog task.max-lwps and the system logs a notice whenever the threshold is crossed, without hurting the application.

Permanent Versus Temporary Changes

Use projmod or projadd with the -K option for permanent changes. Use prctl for live changes that vanish at reboot. For example, prctl -n project.cpu-shares -v 10 -r -i project group.staff replaces the share value on a running project. Unit modifiers such as 1K work in commands but not inside the project file itself.

Step Four: Share CPU Fairly With the Fair Share Scheduler

The fair share scheduler (FSS) divides CPU by shares rather than by timesharing priority. Shares are relative, not percentages. What matters is a project's shares compared with the other active projects that compete for the same CPUs.

How Shares Play Out

ScenarioSharesResult
Two busy projects, each with two CPU-bound processesA=1, B=3A gets 25 percent, B gets 75 percent
One process each, no competitionA=1, B=10050/50, because shares do not matter
Two busy projects, one with zero sharesA=1, B=0B starves while A is busy

Shares only limit CPU when there is contention. A lone project always gets everything, so cycles are never wasted. The maximum is 65535 shares per project, and a project with no defined value gets one share.

Making FSS Active

FSS must be the default scheduler for shares to take effect. Run dispadmin -d FSS for the next reboot, then priocntl -s -c FSS -i all to move running processes now.

Avoid mixing FSS with timesharing, interactive, or fixed-priority processes on the same processor set, because they use the same priority range. The real-time class uses a separate range and can coexist, though FSS cannot control it.

Step Five: Cap Memory and Partition CPUs

Memory Caps With rcapd

Memory is handled by the resource capping daemon. Add rcap.max-rss to a project, for example projmod -s -K rcap.max-rss=10GB db, then enable it with rcapadm -E.

Unlike resource controls, caps are enforced asynchronously at user level, so there is a small delay based on the sampling interval. The default intervals are 15 seconds for scans, 5 for samples, 5 for reports, and 60 for reconfiguration.

Set caps carefully. Too low, and the workload pages constantly. Too high, and the kernel manages memory instead of the daemon. Use rcapstat 5 5 to watch behavior. If the RSS keeps bouncing back to the cap while page-outs stay positive, the working set is larger than the cap. In the documentation's example, raising a 6 GB cap to 10 GB showed the project settled at about 6.1 GB.

Resource Pools

Pools partition CPUs into processor sets, optionally with a scheduling class. Enable them with svcadm enable system/pools:default, then build and commit a configuration:

  1. pooladm -s saves the current state to /etc/pooladm.conf
  2. poolcfg -c 'create pset pset_batch (uint pset.min = 2; uint pset.max = 10)'
  3. poolcfg -c 'create pool pool_batch'
  4. poolcfg -c 'associate pool pool_batch (pset pset_batch)'
  5. pooladm -c commits it

Bind workloads with the project.pool attribute or the poolbind command. Dynamic resource pools add the poold daemon, which shifts CPUs between sets to meet objectives such as keeping utilization below 80 percent. Dynamic pools depend on the base pools service being enabled.

Practical Tips

  • Start with none actions and syslog logging to learn real behavior
  • Leave a margin: do not set a cap right at observed peak
  • Keep one scheduling class per processor set
  • Back up with pooladm -s /tmp/backup before changing pools
  • Use pooladm -n -c style validation before committing large changes

For the full reference, see the official Solaris 10 resource management administration guide on Oracle's documentation site.

FAQ

What is the Sol One resource management guide about?

It covers how to control CPU, memory, and other resources on Solaris 10 systems. Here that means projects and tasks, resource controls, the fair share scheduler, the resource capping daemon, and pools.

Do CPU shares equal percentages?

No. Shares are relative weights. Only the ratio among active, competing projects matters, and shares have no effect when nothing competes for CPU.

Are resource control changes permanent?

Changes made with prctl apply immediately but are lost at reboot. Permanent changes belong in the project database, and they apply to new tasks only.

Which part of this Sol One resource management guide should I set up first?

Define projects, then watch usage with prstat -J and extended accounting. Add controls, FSS, caps, or pools only after you know which workloads actually conflict.