![]() |
![]() |
| ||||||||||||||||||||
Chapter 5Projects and TasksThis chapter discusses the project and task facilities of Solaris resource management. Projects and tasks are used to label workloads and separate them from one another. The project provides a network-wide administrative identifier for related work. The task collects a group of processes into a manageable entity that represents a workload component. OverviewTo optimize workload response, you must first be able to identify the workloads that are running on the system you are analyzing. This information can be difficult to obtain by using either a purely process-oriented or a user-oriented method alone. In the Solaris environment, you have two additional facilities that can be used to separate and identify workloads: the project and the task. Based on their project or task membership, running processes can be manipulated with standard Solaris commands. The extended accounting facility can report on both process usage and task usage, and tag each record with the governing project identifier. This process enables offline workload analysis to be correlated with online monitoring. The project identifier can be shared across multiple machines through the project name service database. Thus, the resource consumption of related workloads that run on (or span) multiple machines can ultimately be analyzed across all of the machines. ProjectsThe project identifier is an administrative identifier that is used to identify related work. The project identifier can be thought of as a workload tag equivalent to the user and group identifiers. A user or group can belong to one or more projects. These projects can be used to represent the workloads in which the user or group of users is allowed to participate. This membership can then be the basis of chargeback that is based on, for example, usage or initial resource allocations. Although a user must have a default project assigned, the processes that the user launches can be associated with any of the projects of which that user is a member. Determining a User's Default ProjectTo log in to the system, a user must be assigned a default project. Because each process on the system possesses project membership, an algorithm to assign a default project to the login or other initial process is necessary. The algorithm to determine a default project consists of four steps. If no default project is found, the user's login, or request to start a process, is denied. The system sequentially follows these steps to determine a user's default project:
This logic is provided by the getdefaultproj() library function (see getprojent(3PROJECT)). project DatabaseYou can store project data in a local file, in a Network Information Service (NIS) project map, or in a Lightweight Directory Access Protocol (LDAP) directory service. The /etc/project database or name service is used at login and by all requests for account management by the pluggable authentication module (PAM) to bind a user to a default project. Note - Updates to entries in the project database, whether to the /etc/project file or to a representation of the database in a network name service, are not applied to currently active projects. The updates are applied to new tasks that join the project when login(1) or newtask(1) is used. PAM SubsystemOperations that change or set identify include logging in to the system, invoking an rcp or rsh command, using ftp, or using su. When an operation involves changing or setting identity, a set of configurable modules is used to provide authentication, account management, credentials management, and session management. The account management PAM module for projects is documented in the pam_projects(5) man page. The PAM system is documented in the man pages pam(3PAM), pam.conf(4), and pam_unix(5). Name Service ConfigurationResource management supports the name service project database. The location where the project database is stored is defined in /etc/nsswitch.conf. By default, files is listed first, but the sources can be listed in any order.
If more than one source for project information is listed, the nsswitch.conf file directs the routine to start searching for the information in the first source listed. The routine then searches subsequent databases. For more information on /etc/nsswitch.conf, see "The Name Service Switch (Overview)" in System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP) and nsswitch.conf(4). Local project File FormatIf you select files as your project database in nsswitch.conf, the login process searches the /etc/project file for project information (see projects(1) and project(4)). The project file contains a one-line entry for each project recognized by the system, of the following form:
The fields are defined as follows.
Note - Routines that read this file halt when they encounter a malformed entry. Any project assignments that are specified after the incorrect entry are not made. This example shows the default /etc/project file:
This example shows the default /etc/project file with project entries added at the end:
To add resource controls to the /etc/project file, see Using Resource Controls. Name Service Configuration for NISIf you are using NIS, you can specify in the /etc/nsswitch.conf file to search the NIS maps for projects:
The NIS map, either project.byname or project.bynumber, has the same form as the /etc/project file:
For more information, see System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP). Directory Service Configuration for LDAPIf you are using LDAP, you can specify in the /etc/nsswitch.conf file to search the LDAP entries for projects.
For more information on the schema for project entries in an LDAP database, see "Solaris Schemas" in System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP). | ||||||||||||||||||||
| ||||||||||||||||||||