Tuesday, March 8, 2011

How to create a resource pool and bind a project to that pool

Create Resource Pool
  • Enable the resource pool service
    • svcadm enable system/pools:default
  • Enable dynamic resource pool
    • svcadm enable system/pools/dynamic:default
  • Check if both are enabled
    • svcs \*pool\*
  • Create a processor set named oracle_set with 32 processors
    • poolcfg -c 'create pset oracle_set( uint pset.min=32; uint pset.max=32)'
  • Create a pool named oraclePool
    • poolcfg -c ' create pool oraclePool
  • Associate the pool with processor set
    • poolcfg -c 'associate pool oraclePool (pset oracle_set)'
  •  Display the info
    • poolcfg -c info
  • Commit the changes to /etc/pooladm.cfg
    •  pooladm -c
  • Alternatively, you can save the configuration in a file and invoke pooladm with that file
Here is an example of configuration file that creates a pool with 8 CPUs in it

cat sPool:
create pset rac1_set(uint pset.min=8;uint pset.max=8)
create pool rac1Pool
associate pool rac1Pool(pset rac1_set)
transfer to pset rac1_set(cpu 0;cpu 1 ; cpu 2; cpu 3; cpu 4 ; cpu 5 ; cpu 6; cpu 7)

Invoke the following command to save current configuration in /etc/pooladm.conf file.

 if that file does not exist
  • pooladm -s
Execute the following command to execute commands from sPool file
  • poolcfg -f sPool
  • poolcfg -c info
  • pooladm -c
The following commands can be used to delete the pool:

cat delPool
destroy pset rac1_set
destroy pool rac1Pool
poolcfg -f delPool

If poolcfg -c info is not taking the right changes, you may want to flush out current in-memory config and start afresh ...

pooladm -x # flush current in-memory config
pooladm -s # blank /etc/pooladm.conf config

For more info : http://www.brendangregg.com/zones.html


    Bind the oracle project to this pool

    • Set project.pool attribute for oracle project to oraclePool so that oracle project gets binded to oraclePool by default. This implies that all processes starting in this project are bound to the pool automatically
      •  projmod -a -K project.pool=poolname project

    Destroy the processor set and pool set

    • poolcfg -c 'destroy pset oracle_set' /etc/pooladm.conf
    • poolcfg -c 'destroy pool oraclePool'
    • poolcfg -c info
    • pooladm -c
    Bind a process to the resource pool

    The following procedure uses poolbind with the -p option to manually bind a process  to a pool named oraclePool
    • Bind the process named ohare to the resource pool oraclePool
      • # poolbind -p oraclePool <procesid of process to be binded>
    • verify which pool a particular process is binded to
      • $ poolbind -q <process id of binded process)
    Monitor pool and processor set:
    • Execute the following commands
      • poolstat 5
      • poolstat -r pset 5 
    If you cannot find dynamic-resource SMF service (system/pools/dynamic:default ), download dynamic-resource-pools pkg.



    Verify if dynamic-resource-pools package exist on your system or not.
    •  pkg info dynamic-resource-pools
    pkg: info: no packages matching the following patterns you specified are
    installed on the system.  Try specifying -r to query remotely:

            dynamic-resource-pools


    • pkg info resource-pools
              Name: system/resource-mgmt/resource-pools
           Summary: Resource Pools
       Description: core software for resource pools
          Category: System/Core
             State: Installed
         Publisher: solaris
           Version: 0.5.11
     Build Release: 5.11
            Branch: 0.175.1.0.0.9.0
    Packaging Date: Mon Feb 06 23:51:31 2012
              Size: 811.45 kB
              FMRI: pkg://solaris/system/resource-mgmt/resource-pools@0.5.11,5.11-0.                             175.1.0.0.9.0:20120206T235131Z


    • # pkg search dynamic-resource-pools
    INDEX      ACTION VALUE                                               PACKAGE
    pkg.fmri   set    solaris/system/resource-mgmt/dynamic-resource-pools pkg:/syste                             m/resource-mgmt/dynamic-resource-pools@0.5.11-0.175.1.0.0.9.0


    • # pkg install dynamic-resource-pools
               Packages to install:  3
           Create boot environment: No
    Create backup boot environment: No
                Services to change:  5

    DOWNLOAD                                  PKGS       FILES    XFER (MB)
    Completed                                  3/3   1015/1015    52.5/52.5

    PHASE                                        ACTIONS
    Install Phase                              1374/1374

    PHASE                                          ITEMS
    Package State Update Phase                       3/3
    Image State Update Phase                         2/2


     
    Additional info:
    ttp://www.brendangregg.com/zones.html#resource_cpu0

      No comments:

      Post a Comment