Solaris Internals: Solaris 10 and OpenSolaris Kernel Architecture (2nd Edition)

7.2. The Project Database

The /etc/project project file is the heart of workload hierarchy. The project database is maintained on a system through the /etc/project file or over the network through a naming service, such as NIS or LDAP.

The /etc/project file contains five standard projects:

Table 7.1. Standard Projects in /etc/project

Project

Description

system

This project is used for all system processes and daemons.

user.root

All root processes run in the user.root project.

noproject

This special project is for IPQoS.

default

A default project is assigned to every user.

group.staff

This project is used for all users in the group staff.

The /etc/projects file is represented by the following structure:

struct project { char *pj_name; /* name of the project */ projid_t pj_projid; /* numerical project id */ char *pj_comment; /* project description */ char **pj_users; /* vector of pointers to project user names */ char **pj_groups; /* vector of pointers to project group names */ char *pj_attr; /* project attributes string */ }; See project.h

The project structure members include the following:

  • pj_name. Name of the project.

  • pj_projid. Project ID.

  • pj_comment. User-supplied project description.

  • pj_users. Pointers to project user members.

  • pj_groups. Pointers to project group members.

  • pj_attr. Project attributes. Use these attributes to set values for resource controls and project pools.

Through project attributes, the resource usage can be controlled. Four prefixes are used to group the types of resource control attributes:

  • project.*. This prefix denotes attributes that are used to control projects. For example, project.max-device-locked-memory indicates the total amount of locked memory allowed, expressed as a number of bytes. The project.pool attributes binds a project to a resource pool.

  • task.*. This prefix is used for attributes that are applied to tasks. For example, the task.max-cpu-time attribute sets the maximum CPU time that is available to this task's processes, expressed as a number of seconds.

  • process.*. This prefix is used for process controls. For example, the process.max-file-size control sets the maximum file offset that is available for writing by this process, expressed as a number of bytes.

  • zone.*. The zone.* prefix is applied to projects, tasks, and processes in a zone. For example, zone.max-lwps prevents too many LWPs in one zone from affecting other zones. A zone's total LWPs can be further subdivided among projects within the zone within the zone by using project.max-lwps entries.

A full list of resource controls can be found in resource_controls(5).

Категории