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.
| Mechanism | What it does | Main feature | Trade-off |
|---|---|---|---|
| Constraints | Sets hard bounds on consumption | Resource controls (rctls) | Can break applications if set too tight |
| Scheduling | Allocates by a predictable algorithm at intervals | Fair share scheduler (FSS) | Only matters when there is contention |
| Partitioning | Binds a workload to a subset of resources | Resource pools and processor sets | Reserved 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:
- A project attribute in the user's
/etc/user_attrentry - A project named
user.followed by the user ID - A project named
group.followed by the user's default group - 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
| Task | Command |
|---|---|
| Add a project for user mark with ID 4113 | projadd -U mark -p 4113 booksite |
| Add a comment to a project | projmod -c 'Book Auction Project' booksite |
| List projects verbosely | projects -l |
| Delete a project | projdel booksite |
| Check file syntax | projmod -n |
| Show current project | id -p |
| Start a new task in a project | newtask -v -p booksite |
| Move a running process into a new task | newtask -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
| Control | What it limits | Unit |
|---|---|---|
| project.cpu-shares | CPU shares for the fair share scheduler | Shares |
| project.cpu-cap | Absolute CPU use (100 equals one full CPU) | CPUs |
| project.max-lwps | Lightweight processes in a project | Count |
| task.max-lwps | Lightweight processes per task | Count |
| process.max-file-descriptor | Highest file descriptor index | Index |
| project.max-shm-memory | System V shared memory | Bytes |
| process.max-cpu-time | CPU time per process | Seconds |
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
| Scenario | Shares | Result |
|---|---|---|
| Two busy projects, each with two CPU-bound processes | A=1, B=3 | A gets 25 percent, B gets 75 percent |
| One process each, no competition | A=1, B=100 | 50/50, because shares do not matter |
| Two busy projects, one with zero shares | A=1, B=0 | B 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:
pooladm -ssaves the current state to/etc/pooladm.confpoolcfg -c 'create pset pset_batch (uint pset.min = 2; uint pset.max = 10)'poolcfg -c 'create pool pool_batch'poolcfg -c 'associate pool pool_batch (pset pset_batch)'pooladm -ccommits 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
noneactions 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/backupbefore changing pools - Use
pooladm -n -cstyle 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.
Related Guides
Sol One Beginner Guide: Sol Badguy Basics, Combos and Mix-Ups in Guilty Gear Strive
Our Sol One beginner guide covers Sol Badguy's key normals, three easy combos, blockstrings and a practice plan to win your first matches in Guilty Gear Strive.
Sol One Beginner Tips: Survive Your First Day on Mars
Sol One beginner tips for Mars survival: power, air, food, wiring, and base basics drawn from an early preview build, plus a FAQ for new players.
Sol One How to Get Home: Build Your Rocket and Escape Mars (Early Access Guide)
Sol One how to get home explained: the rocket goal, survival basics, Mars dangers, farming, exploration, PC requirements and launch details for Early Access.
Sol One How to Survive on Mars: A Beginner's Guide to Power, Oxygen and Building a Base
Learn Sol One how to survive on Mars: power, oxygen, mining, smelting, base building and rocket goals, based on the demo and early-access plans.