Thursday, May 17, 2012

Using kctune to change kernel paramaters


Changes that needs reboot

Normal output

# /usr/sbin/kctune ninode
Tunable  Value  Expression
ninode    8192  Default

Detailed output
# /usr/sbin/kctune -v ninode
Tunable             ninode
Description         Maximum number of HFS file system open inodes that can be in memory.
Module              ufs
Current Value       8192 [Default]
Value at Next Boot  Default (automatic)
Value at Last Boot  8192
Default Value       8192 (automatic)
Constraints         ninode >= 14
Can Change          At Next Boot Only

Changing the parameter

# /usr/sbin/kctune ninode=34816
NOTE:    The requested changes could not be applied to the currently
         running system, for the following reasons:
         - The tunable 'ninode' cannot be changed without a reboot.
       * The requested changes have been saved, and will take effect at
         next boot.
Tunable               Value  Expression
ninode   (now)         8192  Default
         (next boot)  34816  34816
# /usr/sbin/kctune ninode
Tunable               Value  Expression
ninode   (now)         8192  Default
         (next boot)  34816  34816


Changes that affects immediately without reboot

# /usr/sbin/kctune maxfiles_lim
Tunable       Value  Expression  Changes
maxfiles_lim   4096  Default     Immed

# /usr/sbin/kctune -v maxfiles_lim
Tunable             maxfiles_lim
Description         Hard maximum number of file descriptors per process
Module              fs
Current Value       4096 [Default]
Value at Next Boot  4096 [Default]
Value at Last Boot  4096
Default Value       4096
Constraints         maxfiles_lim >= 32
                    maxfiles_lim <= 1048576
                    maxfiles_lim >= maxfiles
Can Change          Immediately or at Next Boot


Changing the parameter

# /usr/sbin/kctune maxfiles_lim=63488
     ==> Update the automatic 'backup' configuration first? yes
       * The automatic 'backup' configuration has been updated.
       * Future operations will update the backup without prompting.
WARNING: The validity of the tunable values could not be completely
         verified, because the value of the tunable 'maxfiles' will not
         be known until the system is booted. The tunable values will be
         verified during boot. Please check the console messages during
         boot to see if there are any tunable value errors.
       * The requested changes have been applied to the currently
         running configuration.
Tunable                 Value  Expression  Changes
maxfiles_lim  (before)   4096  Default     Immed
              (now)     63488  63488
#

No comments:

Post a Comment