Security, Performance, and Accounting Administration
검색에만이 책은
PDF로 이 문서 다운로드

Tuning Kernel Parameters

A

The SunOS 5.x kernel modules are automatically loaded when they are needed. This makes rebuilding the kernel unnecessary. There are parameters for the kernel and kernel modules that you can tune. However, you shouldn't need to change these parameters, except under special circumstances. Many parameters automatically scale as a function of the value assigned to the maxusers parameter.
This appendix lists some of the kernel parameters that you can change or tune. You can change any global variable that is one of the following data types-- int, long, short, or char--by entering a line in the /etc/system file.

· How to List the Kernel Parameters

To see the current values assigned to the kernel parameters. * Type sysdef -i and press Return.

· How to Change the Value of a Parameter

To set the value of a parameter: 1. Enter a line in the /etc/system file in the form: set parameter=value
The following example sets the value of the max_nprocs to 500 parameter.

  set max_nprocs=500  

  1. Reboot the system.

    The kernel parses the /etc/system file during autoconfiguration and overrides the default value for the parameters specified in this file.

To set the value of a module variable: 1. Enter a line in the /etc/system file in the form: set module_name:variable=value
The following example sets the value of the msginfo_msgmap parameter in the msgsys module to 150.

  set msgsys:msginfo_msgmap=150  

  1. Reboot the system.

    The kernel parses the /etc/system file during autoconfiguration and overrides the default value for the parameters specified in this file.

Buffer Cache Parameters

The bufhwm parameter specifies the maximum size for buffer cache memory usage expressed in units of 1K bytes. The default is 2% of physical memory.

UFS File System Parameters

The following table describes the tunable UFS parameters.
Table A-1
ParameterDescription
ufs_ninodeMaximum size of the inode table
(default = max_nprocs + 16 + maxusers+ 64)
ncsizeNumber of dnlc entries (default = max_nprocs+16+maxusers + 64); dnlc is the directory-name lookup cache.

STREAMS Parameters

The following table describes the tunable STREAMS parameters.
Table A-2
ParameterDefaultDescription
nstrpush9This is the maximum number of STREAMS pushes allowed.
strmsgsz0This is the maximum size for the STREAMS message that a user can create. A value of 0 indicates no upper bound. This parameter may disappear entirely in a future release.
strctlsz1024This is the maximum size of the ctl part of a message.
strthresh0This is the maximum amount of dynamic memory that the STREAMS subsystem can consume, in bytes. Once this threshold is passed, any pushes, opens, and writes on a STREAMS devices will fail for non-root processes. A value of 0 means no limit.
sadcnt16Number of sad devices

Interprocess Communication (IPC) Parameters

The following table describes the tunable interprocess communication parameters.
Table A-3
ParameterDefaultDescription
msginfo_msgmap100Number of entries in the message map
msginfo_msgmax2048Maximum message size
msginfo_msgmnb4096Maximum bytes on queue
msginfo_msgmni50Number of message queue identifiers
msginfo_msgssz8Segment size of a message (should be a multiple of the word size)
msginfo_msgtql40Number of system message headers
msginfo_msgseg1024Number of message segments (must be < 32768)
seminfo_semmap10Number of entries in semaphore map
seminfo_semmni10Number of semaphore identifiers
seminfo_semmns60Number of semaphores in the system
seminfo_semmnu30Number of undo structures in the system
seminfo_semmsl25Maximum number of semaphores, per id
seminfo_semopm10Maximum number of operations, per semaphore call
seminfo_semume10Maximum number of undo entries, per process
seminfo_semvmx32767Semaphore maximum value
seminfo_semaem16384Maximum value for adjustment on exit
shminfo_shmmax1048576Maximum shared memory segment size
shminfo_shmmin1Minimum shared memory segment size
shminfo_shmmni100Number of shared memory identifiers
shminfo_shmseg6Segments, per process

· How to Tune the Message Queue Parameters

* Tune the msgsys parameters using the following syntax:
  set msgsys:msginfo_variable=value

* Tune the semsys parameters using the following syntax:

  set semsys:seminfo_variable=value

* Tune the shmsys parameters using the following syntax:

  set shmsys:shminfo_variable=value

TPI Loopback Pseudo-Driver Parameters

The following table describes the tunable TPI loopback pseudo-driver parameters.
Table A-4
ParameterDefaultDescription
tune_t_gpgslo25If freemem < t_getpgslow, the system starts to steal pages from processes. If freemem drops below t_gpgslo, the system wakes up the swapper process. The swapper will try to free some memory by swapping processes to disk.
tune_t_fsflush r30Rate at which fsflush is run, in seconds
tune_t_minarme m25The minimum available resident (not swappable) memory needed to avoid deadlock, in pages
tune_t_minasme m25The minimum available swappable memory needed to avoid deadlock, in pages
tune_t_flckrec512The maximum number of active frlocks
putbufsz2000Size of the putchar buffer
npty48Total number of 4.x pseudo-ttys configured
pt_cnt48Total number of 5.x pseudo-ttys configured

Note - Both the freemem and t_gpgslo parameters are defined in pages. Utilities like vmstat translates freemem into bytes from pages.

· How to Tune the TPI Loopback Pseudo-Driver Parameters

* Tune the tune parameters using the following syntax: set tune:variable=value.

Miscellaneous Parameters

The following table describes a tunable miscellaneous parameter.
Table A-5 Miscellaneous
ParameterDefaultDescription
lwp_default_stksize8192Size of the kernel stack for lwps. Do not adjust this value unless there is a kernel overflow. The value is expressed in bytes and must be a multiple of PAGESIZE bytes.