Solaris Limit ressource used by a zone
id : 2n5pitwm4i
category : computer
blog : unixlinux
created : 09/28/10 - 18:24:15

Add required pkg
  • Get package on a temporary directory :
# ls /tmp/SUN*
SUNWfss SUNWrcapr SUNWrcapu:

  • Install these packages :
# pkgadd -d .


Change global zone default scheduling class
  • Check default scheduling class :
# dispadmin -d
dispadmin: Default scheduling class is not set

  • Change default scheduling class and reboot:
# dispadmin -d FSS
# reboot

  • After reboot check default scheduling class :
# dispadmin -d
FSS     (Fair Share)


Change zone configuration
  • CPU Share :
# zonecfg -z <zone>
# zonecfg:zone> add rctl
# zonecfg:zone:rctl> set name=zone.cpu-shares
# zonecfg:zone:rctl> add value (priv=privileged,limit=<number_of_cpu_shares>,action=none)
# zonecfg:zone:rctl> end
# zonecfg:zone> commit
# zonecfg:zone> exit
or
# zonecfg:zone> set cpu-shares=<number_of_cpu_shares>
# zonecfg:zone> exit

  • Maximum process :
# zonecfg -z <zone>
# zonecfg:zone> set max-lwps=<number_of_process>
# zonecfg:zone> commit
# zonecfg:zone> exit

  • Memory limits :
# zonecfg -z <zone>
# zonecfg:zone> add capped-memory
# zonecfg:zone:capped-memory> set physical=<X>m
# zonecfg:zone:capped-memory> set swap=<Y>m
# zonecfg:zone:capped-memory> end
# zonecfg:zone> commit
# zonecfg:zone> exit

  • Remove cpu-shares :
# zonecfg -z zone
# zonecfg:zone> remove rctl
# zonecfg:zone> exit
or
# zonecfg:zone> clear cpu-shares
# zonecfg:zone> exit

  • Remove max process :
# zonecfg -z zone
# zonecfg:zone> clear max-lwps
# zonecfg:zone> exit

  • Remove memory limits :
# zonecfg -z zone
# zonecfg:zone> remove capped-memory
# zonecfg:zone> exit


Reboot your zone
# zoneadm -z <zone> reboot