|
| 以 PDF 格式下載這本書
Tuning Kernel Parameters
73
- This chapter describes the procedures for tuning kernel parameters. This is a list of the step-by-step instructions in this chapter.
-
· How to List the Kernel Parameters
- Display the current kernel parameters values by using the sysdef command.
-
# sysdef -i
* Hostid
53001b80
*
* sun4c Configuration
* Devices
packages (driver not attached)
disk-label (driver not attached)
deblocker (driver not attached)
obp-tftp (driver not attached)
.
.
.
* Loadable Objects
drv/arp
hard link: strmod/arp
drv/bpp
.
.
.
* System Configuration
swap files
swapfile dev swaplo blocks free
/dev/dsk/c0t1d0s1 32,9 8 205352 205352
*
* Tunable Parameters
561152maximum memory allowed in buffer cache (bufhwm)
426maximum number of processes (v.v_proc)
99maximum global priority in sys class (MAXCLSYSPRI)
.
.
.
* Utsname Tunables
* 5.4 release (REL)
minnie node name (NODE)
SunOS system name (SYS)
prefcs3 version (VER)
.
.
.
|
· How to Change the Value of a Kernel Parameter
-
-
Become root.
-
Add a line to the /etc/system file in the form:
set parameter=value
-
Reboot the system.
The kernel parses the /etc/system file during autoconfiguration and overrides the default value for the parameters specified in this file.
Example--Changing the Value of a Kernel Parameter
- The following line in the /etc/system file sets the value of the max_nprocs to 500 parameter.
-
-
set max_nprocs=500
· How to Set the Value of a Kernel Module Variable
-
-
Become root.
-
Add a line to the /etc/system file in the form:
set module_name:variable=value
-
Reboot the system.
The kernel parses the /etc/system file during autoconfiguration and overrides the default value for the parameters specified in this file.
Example--Setting the Value of a Kernel Module Variable
- The following line in the /etc/system file sets the value of the msginfo_msgmap parameter in the msgsys module to 150.
-
-
set msgsys:msginfo_msgmap=150
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. Use sar(1M) to measure the buffer cache statistics.
UFS File System Parameters
-
Table 73-1 describes the tunable UFS parameters.
-
Table 73-1
| Parameter | Description |
| ufs_ninode | Maximum size of the inode table
(default = max_nprocs + 16 + maxusers+ 64) |
| ncsize | Number of dnlc entries (default = max_nprocs+16+maxusers + 64); dnlc is the directory-name lookup cache. |
STREAMS Parameters
-
Table 73-2 describes the tunable STREAMS parameters.
-
Table 73-2
| Parameter | Default | Description |
| nstrpush | 9 | The maximum number of STREAMS pushes allowed. |
| strmsgsz | 0 | 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. |
| strctlsz | 1024 | The maximum size of the ctl part of a message. |
| strthresh | 0 | 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. |
| sadcnt | 16 | Number of sad devices. |
Interprocess Communication (IPC(TM)) Parameters
-
Table 73-3 describes the tunable interprocess communication parameters.
-
Table 73-3
| Parameter Type | Parameter | Default | Description |
| Message Queue | msginfo_msgmap | 100 | Number of entries in the message map |
| msginfo_msgmax | 2048 | Maximum message size |
| msginfo_msgmnb | 4096 | Maximum bytes on queue |
| msginfo_msgmni | 50 | Number of message queue identifiers |
| msginfo_msgssz | 8 | Segment size of a message (should be a multiple of the word size) |
| msginfo_msgtql | 40 | Number of system message headers |
| msginfo_msgseg | 1024 | Number of message segments (must be < 32768) |
| Semaphore Facility | seminfo_semmap | 10 | Number of entries in the semaphore map |
| seminfo_semmni | 10 | Number of semaphore identifiers |
| seminfo_semmns | 60 | Number of semaphores in the system |
| seminfo_semmnu | 30 | Number of undo structures in the system |
| seminfo_semmsl | 25 | Maximum number of semaphores, per id |
| seminfo_semopm | 10 | Maximum number of operations, per semaphore call |
| seminfo_semume | 10 | Maximum number of undo entries, per process |
| seminfo_semvmx | 32767 | Semaphore maximum value |
| seminfo_semaem | 16384 | Maximum value for adjustment on exit |
| Shared Memory | shminfo_shmmax | 1048576 | Maximum shared memory segment size |
| shminfo_shmmin | 1 | Minimum shared memory segment size |
| shminfo_shmmni | 100 | Number of shared memory identifiers |
| shminfo_shmseg | 6 | Segments, per process |
· How to Tune the Interprocess Communication Parameters
-
-
Become root.
-
Add a line to the /etc/system file using the syntax described in Table 73-4.
-
Table 73-4
| Parameter Type | Parameter | Tuning Syntax |
| Message Queue | msgsys | set msgsys:msginfo_variable=value |
| Semaphore Facility | semsys | set semsys:seminfo_variable=value |
| Shared Memory | shmsys | set shmsys:shminfo_variable=value |
-
-
Reboot the system.
The kernel parses the /etc/system file during autoconfiguration and overrides the default value for the parameters specified in this file.
Memory Management Parameters
-
Table 73-5 describes the tunable memory management parameters.
-
Table 73-5
| Parameter | Default | Description |
| lotsfree | scaled based on physical memory | If freemem drops below lotsfree, the system starts to steal pages from processes. |
| tune_t_fsflushr | 30 | Rate at which fsflush is run, in seconds |
| tune_t_minarmem | 25 | The minimum available resident (not swappable) memory needed to avoid deadlock, in pages |
| tune_t_minasmem | 25 | The minimum available swappable memory needed to avoid deadlock, in pages |
| tune_t_flckrec | 512 | The maximum number of active frlocks |
-
Note - Since the Solaris 2.4 release, the tune_t_gpgslo parameter has been replaced by a more complicated criteria for swapping based on the number of runnable threads. More information on this new criteria will be available for the Solaris 2.5 FCS release.
- The freemem parameter is defined in pages. Utilities like vmstat translates freemem into bytes from pages.
· How to Tune Memory Management Parameters
-
-
Become root.
-
Add a line to the /etc/system file using the following syntax.
-
-
set tune:variable=value
-
-
Reboot the system.
The kernel parses the /etc/system file during autoconfiguration and overrides the default value for the parameters specified in this file.
Miscellaneous Parameters
-
Table 73-6 describes tunable miscellaneous parameters.
-
Table 73-6
| Parameter | Default | Description |
| lwp_default_stksize | 8192 | Size 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. |
| npty | 48 | Total number of 4.x pseudo-ttys configured |
| pt_cnt | 48 | Total number of 5.x pseudo-ttys configured |
· How to Tune Miscellaneous Parameters
-
-
Become root.
-
Add a line to the /etc/system file using the following syntax.
set parameter=value
-
Reboot the system.
If you changed device related kernel parameters, you need to use the -r option when booting the system. When the system boots, the kernel parses the /etc/system file during autoconfiguration and overrides the default value for the parameters specified in this file.
Example--Tuning Miscellaneous Parameters
- The following line in the /etc/system file sets the value of the pt_cnt parameter to 200.
-
-
set pt_cnt=200
|
|