Skip Navigation Links | |
Exit Print View | |
![]() |
Solaris Containers: Resource Management and Solaris Zones Developer's Guide |
1. Resource Management in the Solaris Operating System
3. Using the C Interface to Extended Accounting
4. Using the Perl Interface to Extended Accounting
7. Design Considerations for Resource Management Applications in Solaris Zones
The project file is a local source of project information. The project file can be used in conjunction with other project sources, including the NIS maps project.byname and project.bynumber and the LDAP database project. Programs use the getprojent(3PROJECT) routines to access this information.
/etc/project defines two projects: database and appserver. The user defaults are user.database and user.appserver. The admin default can switch between user.database or user.appserver.
hostname# cat /etc/project
. . . user.database:2001:Database backend:admin:: user.appserver:2002:Application Server frontend:admin:: . .
The /etc/project file shows the resource controls for the application.
hostname# cat /etc/project
. . . development:2003:Developers:::task.ax-lwps=(privileged,10,deny); process.max-addressspace=(privileged,209715200,deny) . .
The /etc/project file shows the resource pools for the application.
hostname# cat /etc/project
. . . batch:2001:Batch project:::project.pool=batch_pool process:2002:Process control:::project.pool=process_pool . . .
Set up FSS for two projects: database and appserver. The database project has 20 CPU shares. The appserver project has 10 CPU shares.
hostname# cat /etc/project
. . . user.database:2001:database backend:admin::project.cpu-shares=(privileged, 20,deny) user.appserver:2002:Application Server frontend:admin::project.cpu-shares= (privileged,10,deny) . . .
Note - The line break in the lines that precede “20,deny” and “(privileged,” is not valid in an /etc/project file. The line breaks are shown here only to allow the example to display on a printed or displayed page. Each entry in the /etc/project file must be on a single line.
If the FSS is enabled but each user and application is not assigned to a unique project, then the users and applications will all run in the same project. By running in the same project, all compete for the same share, in a timeshare fashion. This occurs because shares are assigned to projects, not to users or processes. To take advantage of the FSS scheduling capabilities, assign each user and application to a unique project.
To configure a project, see Local /etc/project File Format in System Administration Guide: Solaris Containers-Resource Management and Solaris Zones.
The following example configures five applications with different characteristics.
Table 8-1 Target Applications and Characteristics
|
Note - Consolidate database applications (app.db and geo_db) onto a single processor set of at least four CPUs. Use FSS scheduling class. Application app_db gets 25% of the project.cpu-shares. Application geo_db gets 75% of the project.cpu-shares.
Edit the /etc/project file. Map users to resource pools for the app_server, app_db, development, tp_engine, and geo_db project entries.
hostname# cat /etc/project
. . . user.app_server:2001:Production Application Server:: project.pool=appserver_pool user.app_db:2002:App Server DB:::project.pool=db_pool, project.cpu-shares=(privileged,1,deny) development:2003:Test and delopment::staff:project.pool=dev.pool, process.max-addressspace=(privileged,536870912,deny) user.tp_engine:Transaction Engine:::project.pool=tp_pool user.geo_db:EDI DB:::project.pool=db_pool; project.cpu-shares=(privileged,3,deny)
Note - The line break in the lines that begin with “project.pool” , “project.cpu-shares=”, “process.max-addressspace”, and “project.cpu-shares=” is not valid in a project file. The line breaks are shown here only to allow the example to display on a printed or displayed page. Each entry must be on one and only one line.
Create the pool.host script and add entries for resource pools.
hostname# cat pool.host
create system host create pset dev_pset (unit pset.max = 2) create pset tp_pset (unit pset.min = 2) create pset db_pset (unit pset.min = 4; uint pset.max = 6) create pset app_pset (unit pset.min = 1; uint pset.max = 2) create pool dev_pool (string pool.scheduler="IA") create pool appserver_pool (string pool.scheduler="TS") create pool db_pool (string pool.scheduler="FSS") create pool tp_pool (string pool.scheduler="TS") associate pool pool_default (pset pset_default) associate pool dev_pool (pset dev_pset) associate pool pool appserver_pool (pset app_pset) associate pool db_pool (pset db_pset) associate pool tp_pool (pset tp_pset)
Note - The line break in the line that begins with “boolean” is not valid in a pool.host file. The line break is shown here only to allow the example to display on a printed or displayed page. Each entry must be on one and only one line.
Run the pool.host script and modify the configuration as specified in the pool.host file.
hostname# poolcfg —f pool.host
Read the pool.host resource pool configuration file and initialize the resource pools on the system.
hostname# pooladm —c