7.1. Projects and Tasks FrameworkIn this section, we describe the central administration objects that are used for resource management, observability and accounting in Solaris. 7.1.1. IntroductionThe project and task entities are used in Solaris to describe workloads, which consist of a set of related processes. Processes are grouped into tasks, tasks are a member of a project. Projects and tasks are used to control and observe the resources of a workload. Some of the key uses for the Project and Tasks in Solaris are:
Figure 7.1. Projects and Tasks Hierarchy7.1.2. ProjectsThe project participates in the administrative model at a level equivalent to a user or group ID. A user who is a member of more than one project can run processes in multiple projects at the same time. All processes that are started by a process inherit the project of the parent process. When you switch to a new project in a startup script, all child processes run in the new project. An executing user process has an associated user identity (uid), group identity (gid), and project identity (projid). Process attributes and abilities are inherited from the user, group, and project identities to form the execution context for a task. 7.1.3. TasksA task is a group of related processes associated with a project. Processes inherit their project and task identifiers across fork(2) and exec(2); a new task is created when a new project identifier is bound to a process. Resource consumption by a task is charged to a project. The resources tracked by the accounting system are configurable systemwide. The project acts as a source of resources to be made available to that same collection of related work, allowing resource controls and limits to be set for each task. Section 7.5. Tasks are formally distinct from sessions (see setsid(2)) so as to avoid unnecessarily contaminating the semantics of tasks with the semantics of terminals. A new task is created for each login session when the user's project is bound to the user's login shell. Within a login session, the project ID can be changed with the newtask(1) utility. This command can also be used to run applications against different projects in the same session while preserving full shell task control semantics for the invoking shell. 7.1.4. Why We Added Tasks to SolarisThe basic requirements for tasks stem from the associated accounting capabilities: the actions of a task must be accountable, and the set of actions must be equivalent to the typical actions performed during an interactive login or a queue submission. Furthermore, an interactive user must be able to switch projects during his login session. There were two viable process aggregates in standard UNIX implementations: process groups and sessions:
For these reasons, and to avoid any compatibility complications from changes to the POSIX session definition, the task is introduced as an unencumbered entity to represent a distinct family of related processes in Solaris. |