The OpenNET Project / Index page

[ /++ | | wiki | ]

/ " Solaris" ( | )

Solaris 10 Containers.


:
: solaris-center.ru - Solaris

Resource Management, Solaris Containers, Sun Solaris 10.

.

:

Solaris : Solaris Resource Manager, (, , ), Solaris Bandwidth Manager, . Sun Solaris ( Solaris 8) . , , Solaris 10 15 .

Solaris 10 Solaris Containers. , , .

Solaris Containers : - Resource Management - Solaris Zones, ( Solaris Containers. .)

Resource Management , , .

:

  • Scheduling. . - , .
  • Partitioning. . .
  • Constraint. .

 

Solaris : project() task(). , . :

, . , . . , , .

:

  • /etc/user_attr ( ) , project
  • /etc/project user. user_id, default
  • /etc/project group.group-name, default , (primary)
  • default /etc/project,

, , /etc/project. : NIS, NIS+, LDAP.

:

projname:projid:comment:user-list:group-list:attributes


projname
projid
comment ( )
user-list ,
group-list ,
attributes ,

 

/etc/project:

 

# cat /etc/project

system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
 

, , (. ). ID .

/:

  • login
  • cron
  • su
  • newtask
  • setproject

, , :

1. id ps :

bash-2.05b$ id -p
uid=101(urix) gid=1(other) projid=3(default)

bash-2.05b$ ps -o user,pid,uid,projid
USER PID UID PROJID
urix 2311 101 3
urix 2369 101 3

 

root:

# id -p
uid=0(root) gid=1(other) projid=1(user.root)

# ps -o user,pid,uid,projid
USER PID UID PROJID
root 2203 0 1
root 2352 0 1

 

2. prstat , , ( - J):

# prstat J

PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
2185 urix 61M 10M sleep 59 0 0:00:01 0.5% gnome-terminal/1
2397 root 6136K 5072K cpu1 59 0 0:00:00 0.1% prstat/1
2169 urix 56M 8440K sleep 59 0 0:00:00 0.1% metacity/1
2392 urix 6136K 5080K sleep 59 0 0:00:00 0.0% prstat/1
2175 urix 62M 12M sleep 59 0 0:00:01 0.0% gnome-panel/1
2195 urix 60M 10M sleep 59 0 0:00:00 0.0% mixer_applet2/1
2127 urix 2464K 1040K sleep 59 0 0:00:00 0.0% dsdm/1
2166 urix 3616K 2544K sleep 59 0 0:00:00 0.0% gnome-smproxy/1
2189 urix 54M 6128K sleep 59 0 0:00:00 0.0% galf-server/1
611 root 3656K 2272K sleep 59 0 0:00:00 0.0% snmpXdmid/2
571 root 2216K 1056K sleep 59 0 0:00:00 0.0% rpc.bootparamd/1
462 root 1880K 536K sleep 59 0 0:00:00 0.0% smcboot/1
463 root 1872K 352K sleep 59 0 0:00:00 0.0% smcboot/1
464 root 1872K 368K sleep 59 0 0:00:00 0.0% smcboot/1
499 root 5360K 2024K sleep 59 0 0:00:00 0.0% htt_server/2
788 root 2088K 1328K sleep 59 0 0:00:00 0.0% init/1
410 root 2544K 592K sleep 59 0 0:00:00 0.0% cron/1
423 root 2968K 2128K sleep 59 0 0:00:00 0.0% nscd/24
406 root 3944K 1680K sleep 59 0 0:00:00 0.0% syslogd/15
407 root 3840K 1664K sleep 59 0 0:00:00 0.0% automountd/2
491 root 3752K 1496K sleep 59 0 0:00:00 0.0% utskid/1
328 root 16M 7224K sleep 59 0 0:00:00 0.0% ns-httpd/59
326 root 12M 6720K sleep 59 0 0:00:00 0.0% ns-httpd/2
440 root 1576K 648K sleep 59 0 0:00:00 0.0% powerd/3
325 root 4376K 1184K sleep 59 0 0:00:00 0.0% uxwdog/1
424 root 2384K 816K sleep 59 0 0:00:00 0.0% inetd/1
315 nobody 75M 63M sleep 59 0 0:00:00 0.0% ns-slapd/40
PROJID NPROC SIZE RSS MEMORY TIME CPU PROJECT
3 21 485M 120M 6.0% 0:00:02 0.7% default
1 2 8960K 7200K 0.4% 0:00:00 0.1% user.root
0 90 417M 234M 12% 0:00:04 0.0% system

Total: 113 processes, 373 lwps, load averages: 0.02, 0.02, 0.03

( -T):

# prstat -T

PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
2185 urix 61M 11M sleep 59 0 0:00:02 0.3% gnome-terminal/1
2424 root 6136K 5056K cpu0 59 0 0:00:00 0.1% prstat/1
2173 urix 71M 21M sleep 59 0 0:00:01 0.1% nautilus/8
2175 urix 62M 12M sleep 59 0 0:00:01 0.0% gnome-panel/1
2169 urix 56M 8440K sleep 59 0 0:00:00 0.0% metacity/1
2195 urix 60M 10M sleep 59 0 0:00:00 0.0% mixer_applet2/1
2203 root 2824K 2128K sleep 59 0 0:00:00 0.0% bash/1
2189 urix 54M 6128K sleep 59 0 0:00:00 0.0% galf-server/1
611 root 3656K 2272K sleep 59 0 0:00:00 0.0% snmpXdmid/2
571 root 2216K 1056K sleep 59 0 0:00:00 0.0% rpc.bootparamd/1
462 root 1880K 536K sleep 59 0 0:00:00 0.0% smcboot/1
463 root 1872K 352K sleep 59 0 0:00:00 0.0% smcboot/1
464 root 1872K 368K sleep 59 0 0:00:00 0.0% smcboot/1
499 root 5360K 2024K sleep 59 0 0:00:00 0.0% htt_server/2
788 root 2088K 1328K sleep 59 0 0:00:00 0.0% init/1
410 root 2544K 592K sleep 59 0 0:00:00 0.0% cron/1
423 root 2968K 2128K sleep 59 0 0:00:00 0.0% nscd/24
406 root 3944K 1680K sleep 59 0 0:00:00 0.0% syslogd/15
407 root 3840K 1664K sleep 59 0 0:00:00 0.0% automountd/2
491 root 3752K 1496K sleep 59 0 0:00:00 0.0% utskid/1
328 root 16M 7224K sleep 59 0 0:00:00 0.0% ns-httpd/59
326 root 12M 6720K sleep 59 0 0:00:00 0.0% ns-httpd/2
440 root 1576K 648K sleep 59 0 0:00:00 0.0% powerd/3
325 root 4376K 1184K sleep 59 0 0:00:00 0.0% uxwdog/1
424 root 2384K 816K sleep 59 0 0:00:00 0.0% inetd/1
315 nobody 75M 63M sleep 59 0 0:00:00 0.0% ns-slapd/40
292 daemon 2424K 760K sleep 59 0 0:00:00 0.0% rpcbind/1
TASKID NPROC SIZE RSS MEMORY TIME CPU PROJECT
6 20 479M 115M 5.7% 0:00:04 0.5% default
7 2 8960K 7184K 0.4% 0:00:00 0.1% user.root
2 1 0K 0K 0.0% 0:00:00 0.0% system
3 33 112M 63M 3.1% 0:00:00 0.0% system
1 56 305M 171M 8.5% 0:00:04 0.0% system


Total: 112 processes, 371 lwps, load averages: 0.01, 0.02, 0.03

3. test 150 urix:

# projadd -U urix -p 150 test

 

4. :

# projmod -c "Test project for user urix" test

# cat /etc/project

system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
test:150:Test project for user urix:urix::

 

5. , su, , :

# su - urix

Sun Microsystems Inc. SunOS 5.10 s10_55 May 2004

bash-2.05b$ projects
default test

 

6. test. shell- :

bash-2.05b$ newtask -v -p test
9

bash-2.05b$ id -p
uid=101(urix) gid=1(other) projid=150(test)

 

7. :

bash-2.05b$ exit

exit

bash-2.05b$ id -p
uid=101(urix) gid=1(other) projid=3(default)

 

UNIX . : CPU, , core-, ..

Sun Solaris : , . ʻ (tunable parameters) .

, . - /etc/system. ( Solaris Tunable Parameters Reference Manual).

, , ʻ . , , . , , , /etc/system.

- /etc/project.

:

project.cpu-shares

-

project.max-shm-ids

project.max-sem-ids

project.max-mes-ids

project.max-shm-memory

,

()

project.max-lwps

LWP

project.max-tasks

task.max-cpu-time

()

task.max-lwps

LWP

process.max-cpu-time

()

process.max-file-descriptor

process.max-file-size

,

()

process.max-core-size

core -,

()

process.max-data-size

,

()

process.max-stack-size

,

()

:

  • basic ()
  • privileged ()
  • system ()

, . , . , , .

, , (actions). . , , .

. :

  • none , , . , , .
  • deny , .
  • signal= - . :
      • SIGABRT
      • SIGHUP
      • SIGTERM
      • SIGKILL Ż
      • SIGSTOP
      • SIGXRES
      • SIGXPSZ
      • SIGXCPU CPU

, Solaris Management Console (/usr/sbin/smc), /etc/project.

.2 Solaris Management Console

:

1. test , (task.max-lwps):

# projadd -K 'task.max-lwps=(privileged,3,deny)' test

# cat /etc/project

system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
test:150:Test project for user urix:urix::task.max-lwps=(privileged,3,deny)

 

2. csh; prctl task.max-lwps ػ :

# newtask -p test csh

sunfire# prctl -n task.max-lwps $$
1925: csh
task.max-lwps
3 privileged deny
2147483647 system deny [ max ]

sunfire# id -p
uid=0(root) gid=1(other) projid=150(test)

sunfire# ps -o project,taskid -p $$
PROJECT TASKID
test 7

sunfire# csh
sunfire# csh
sunfire# csh
Vfork failed
sunfire#

 

3 csh !

3. :

# projmod -s -K 'task.max-lwps=(basic,10,none),(privileged,500,deny); process.max-file-descriptor=(basic,128,deny)' test

# cat /etc/project

system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
test:150:Test project for user urix:urix::task.max-lwps=(basic,10,none), (privileged,500,deny);process.max-file-descriptor=(basic,128,deny)

 

, :

# prctl -n process.max-file-descriptor $$
2061: bash
process.max-file-descriptor [ lowerable deny ]
256 basic deny
65536 privileged deny
2147483647 system deny [ max ]
#

# prctl -n task.max-lwps $$
2061: bash
task.max-lwps
2147483647 system deny [ max ]

 

, :

# newtask -p test csh

sunfire# prctl -n process.max-file-descriptor $$
2283: csh
process.max-file-descriptor [ lowerable deny ]
128 basic deny
2147483647 system deny [ max ]

sunfire# prctl -n task.max-lwps $$
2283: csh
task.max-lwps
10 basic none
500 privileged deny
2147483647 system deny [ max ]

 

, , , .

.3 test

4. prctl, . , , :

sunfire# prctl -n task.max-lwps $$
2676: csh
task.max-lwps
10 basic none
500 privileged deny
2147483647 system deny [ max ]

sunfire# prctl -n process.max-file-descriptor $$
2676: csh
process.max-file-descriptor [ lowerable deny ]
128 basic deny
2147483647 system deny [ max ]

 

:

sunfire# prctl -n project.max-lwps -t privileged -v 3 -e deny -i project test

sunfire# prctl -n task.max-lwps $$
2676: csh
task.max-lwps
3 privileged deny
10 basic none
500 privileged deny
2147483647 system deny [ max ]

sunfire# prctl -n process.max-file-descriptor -r -v 256 $$

sunfire# prctl -n process.max-file-descriptor $$
2676: csh
process.max-file-descriptor [ lowerable deny ]
256 basic deny
2147483647 system deny [ max ]

sunfire# exit

#

 

5. rctladm:

# rctladm
process.max-port-events syslog=off [ deny ]
process.crypto-buffer-limit syslog=off [ deny ]
process.max-crypto-sessions syslog=off [ deny ]
process.add-crypto-sessions syslog=off [ deny ]
process.min-crypto-sessions syslog=off [ deny ]
process.max-msg-messages syslog=off [ deny ]
process.max-msg-qbytes syslog=off [ deny ]
process.max-sem-ops syslog=off [ deny ]
process.max-sem-nsems syslog=off [ deny ]
process.max-address-space syslog=off [ lowerable deny no-local-action ]
process.max-file-descriptor syslog=off [ lowerable deny ]
process.max-core-size syslog=off [ lowerable deny no-local-action ]
process.max-stack-size syslog=off [ lowerable deny no-local-action ]
process.max-data-size syslog=off [ lowerable deny no-local-action ]
process.max-file-size syslog=off [ lowerable deny file-size ]
process.max-cpu-time syslog=off [ lowerable no-deny cpu-time inf ]
task.max-cpu-time syslog=off [ no-deny cpu-time no-obs inf ]
task.max-lwps syslog=off
project.max-device-locked-memory syslog=off [ no-basic deny ]
project.max-port-ids syslog=off [ no-basic deny ]
project.max-shm-memory syslog=off [ no-basic deny ]
project.max-shm-ids syslog=off [ no-basic deny ]
project.max-msg-ids syslog=off [ no-basic deny ]
project.max-sem-ids syslog=off [ no-basic deny ]
project.cpu-shares syslog=off [ no-basic no-local-action ]
zone.cpu-shares syslog=off [ no-basic no-local-action ]
#

 

syslog- task.max-lwps:

# rctladm -e syslog task.max-lwps

# rctladm

.

task.max-lwps syslog=notice

.

#

 

6. Solaris Management Console . test:

.4 SMC

/etc/project test:

# cat /etc/project

system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
test:150:Test project for user urix:urix::process.max-cpu-time=(privileged, 10ms, signal=SIGXCPU, deny);process.max-file-descriptor=(basic, 128, deny);task.max-lwps=(basic, 10, none),(privileged, 500, deny)

 

.5 test

 

CPU. Fair Share Scheduler (FSS)

, Sun Solaris, (TS - timesharing scheduling). , . *.max-cpu-time . , , .

, , (FSS - Fair Share Scheduler). FSS (shares) .

, FSS, . , , .

: (idle) (active). , . , , ͻ . , .

, :

n

, 2 , (processor sets). :

n , X

. : , , . . - , , . 1+2+3=6. , :

, , , ( ׻). : 2 cpu+4 cpu+2 cpu. . : - - . .

:

 

, , :

 

 

FSS.

1. , dispadmin, , :

# dispadmin -l

CONFIGURED CLASSES
==================
SYS (System Class)
TS (Time Sharing)
FX (Fixed Priority)
IA (Interactive)
RT (Real Time)

 

2. FSS. ջ :

# dispadmin -d FSS

# dispadmin -l

CONFIGURED CLASSES
==================
SYS (System Class)
TS (Time Sharing)
FX (Fixed Priority)
IA (Interactive)
RT (Real Time)
FSS (Fair Share)

 

3. , , , FSS. priocntl, . init (pid 1) FSS , , :

# priocntl -s -c FSS -i pid 1

# ps -ef -o pset,class | grep -v CLS | sort | uniq
- FX
- TS
- FSS
- SYS

 

, , :

# priocntl -s -c FSS -i class TS
# priocntl -s -c FSS -i projid 150

# ps -ef -o pset,class | grep -v CLS | sort | uniq
- FX
- FSS
- SYS

 

, , , TS.

4. project.cpu-shares :

# prctl -n project.cpu-shares -r -v 5 -i project test

# cat /etc/project

system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
test:150:Test project for user urix:urix::process.max-cpu-time=(privileged, 10ms, signal=SIGXCPU, deny);process.max-file-descriptor=(basic, 128, deny);task.max-lwps=(basic, 10, none),(privileged, 500, deny );project.cpu-shares=(privileged,5,none)

 

 

(Resource pools)

Resource management . . .

FSS. default pool - default processor set. .

:

  • . ,
  • . ,
  • real-time

project.pool /etc/project :

# projmod -s -K project.pool=pool_test test

 

.

/etc/pooladm.conf. , , . . Ի , . XML . , , poolcfg. , , batch- - , .

/etc/pooladm.conf, (cron) , : , , ..

1. ( e , d ):

# pooladm e

 

2. /etc/pooladm.conf :

# pooladm s

# poolcfg -c info

system sunfire
string system.comment
int system.version 1
boolean system.bind-default true
int system.poold.pid 1606

pool pool_default
int pool.sys_id 0
boolean pool.active true
boolean pool.default true
int pool.importance 1
string pool.comment
pset pset_default

pset pset_default
int pset.sys_id -1
boolean pset.default true
uint pset.min 1
uint pset.max 65536
string pset.units population
uint pset.load 9
uint pset.size 2
string pset.comment

cpu
int cpu.sys_id 1
string cpu.comment
string cpu.status on-line

cpu
int cpu.sys_id 0
string cpu.comment
string cpu.status on-line

 

( ) , :

# pooladm s / / _

 

:

# pooladm //_

 

, , :

system.poold.log-level

string

( NOTICE)

system.poold.log-location

string

( /var/log/pool/poold)

system.poold.monitor-interval

unsigned int

()

system.poold.pid

int

PID poold

pset.max

int

.

pset.min

int

.

cpu.pinned

boolean

,

pool.importance

unsigned int

( =1)

system.poold.objectives

string

poold

pset.poold.objectives

string

 

1. :

  • pset_test
  • pool_test
  • , FSS
  • , :

# poolcfg -c 'create pset pset_test (uint pset.min = 1; uint pset.max = 2)'

# poolcfg -c 'create pool pool_test'

# poolcfg -c 'associate pool pool_test (pset pset_test)'

# poolcfg -c modify pool pool_test (string pool.scheduler = "FSS")

 

# poolcfg -c info

system sunfire
string system.comment
int system.version 1
boolean system.bind-default true
int system.poold.pid 1606

pool pool_default
int pool.sys_id 0
boolean pool.active true
boolean pool.default true
int pool.importance 1
string pool.comment
pset pset_default

pool pool_test
boolean pool.active true
boolean pool.default false
string pool.scheduler FSS
int pool.importance 1
string pool.comment
pset pset_test

pset pset_default
int pset.sys_id -1
boolean pset.default true
uint pset.min 1
uint pset.max 65536
string pset.units population
uint pset.load 9
uint pset.size 2
string pset.comment

cpu
int cpu.sys_id 1
string cpu.comment
string cpu.status on-line

cpu
int cpu.sys_id 0
string cpu.comment
string cpu.status on-line

pset pset_test
int pset.sys_id -2
boolean pset.default false
uint pset.min 1
uint pset.max 2
string pset.units population
uint pset.load 0
uint pset.size 0
string pset.comment

# pooladm -c / * * /

 

2. . wt-load , locality none , locality tight .

# poolcfg -c modify system sunfire (string system.poold.objectives = "wt-load")

# poolcfg -c modify pset pset_default (string pset.poold.objectives = "locality none")

# poolcfg -c modify pset pset_test (string pset.poold.objectives = "locality tight; utilization < 80")

# pooladm -c / * * /

 

3. test :

# newtask -p test csh

# poolbind -i project -p pool_test test

sunfire# poolbind -q $$
2646 pool_test

sunfire#

 

4. poolstat :

# poolstat -r pset

id pool type rid rset min max size used load
1 pool_test pset 1 pset_test 1 2 1 0.00 0.02
0 pool_default pset -1 pset_default 1 66K 1 0.00 0.01

 

 

Solaris Containers http://docs.sun.com, Solaris 10, System Administration Guide: Solaris Containers Resource Management and Solaris Zones.

 


    
    
Created 1996-2017 by Maxim Chirkov  
  
Hosting by Ihor