Thursday, July 05, 2007

Solaris Resource Management

From resource control, prcess level
control will pass in pid which is run
time only. So we create project to
assigned user progress to modify the
resource control per project based without
knowing pid. Of course, I want to try
pid too.


(1)Create a project
# projadd -U progress -p 8888 openedge
(2) projmod -c "It is project for resource control on openedge database" openedge
(3)List projects created
# project -l
ksh: project: not found
# projects -l
system (System built-in project, project id 0)
projid : 0
comment: ""
users : (none)
groups : (none)
attribs:
user.root (System built-in project, project id 1)
projid : 1
comment: ""
users : (none)
groups : (none)
attribs:
noproject (System built-in project, project id 2)
projid : 2
comment: ""
users : (none)
groups : (none)
attribs:
default (System built-in project, project id 3
projid : 3
comment: ""
users : (none)
groups : (none)
attribs:
group.staff (System built-in project, project id 10)
projid : 10
comment: ""
users : (none)
groups : (none)
attribs:
openedge (Project we created with designated id 8888)
projid : 8888
comment: "It is project for resource control on openedge database"
users : progress
groups : (none)
attribs:
(3) check project membership


id -p

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

You can see root belongs to built-in project id1 which is user.root

# prstat -J
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
707 noaccess 222M 133M sleep 59 0 0:01:47 0.0% java/55
1025 root 4776K 4232K cpu8 59 0 0:00:00 0.0% prstat/1
118 root 5216K 4728K sleep 59 0 0:00:02 0.0% nscd/26
117 root 4640K 4008K sleep 59 0 0:00:00 0.0% picld/4
125 root 2592K 2080K sleep 59 0 0:00:00 0.0% syseventd/14
258 daemon 2752K 2432K sleep 59 0 0:00:00 0.0% statd/1
371 root 4856K 1672K sleep 59 0 0:00:00 0.0% automountd/2
97 root 2552K 2176K sleep 59 0 0:00:00 0.0% snmpdx/1
55 root 9160K 7528K sleep 59 0 0:00:01 0.0% snmpd/1
308 root 2080K 1224K sleep 59 0 0:00:00 0.0% smcboot/1
259 daemon 2432K 2136K sleep 60 -20 0:00:00 0.0% nfs4cbd/2
249 root 2728K 1632K sleep 59 0 0:00:00 0.0% cron/1
9 root 11M 10M sleep 59 0 0:00:19 0.0% svc.configd/17
7 root 19M 17M sleep 59 0 0:00:08 0.0% svc.startd/12
136 daemon 4680K 3528K sleep 59 0 0:00:00 0.0% kcfd/5
PROJID NPROC SIZE RSS MEMORY TIME CPU PROJECT
1 5 10M 9488K 0.0% 0:00:00 0.0% user.root
3 1 1376K 1280K 0.0% 0:00:00 0.0% default
0 37 390M 257M 0.7% 0:02:21 0.0% system


Total: 43 processes, 218 lwps, load averages: 0.01, 0.01, 0.01

# id -p root
uid=0(root) gid=0(root) projid=1(user.root)
# id -p daemon
uid=1(daemon) gid=1(other) projid=3(default)
# id -p noaccess
uid=60002(noaccess) gid=60002(noaccess) projid=3(default)


svcadm enable system/pools:default (resource pools framework)
svcadm enable system/pools/dynamic:default (dynamic resource pools)
svcadm enable svc:/system/pools:default (enable DRP service)

Check if pool services and dynamic pool service are enabled

# svcs *pool*
STATE STIME FMRI
online 11:10:01 svc:/system/pools:default
online 11:11:05 svc:/system/pools/dynamic:default

No comments: