Contained WithinFind More DocumentationFeatured Support Resources | Download this book in PDF (1345 KB)
Chapter 1 Overview of Solaris System TuningThis section provides overview information about the format of the tuning information in this manual. This section also describes the different ways to tune a Solaris system. What's New in Solaris System Tuning?This section describes new or changed parameters in this Solaris release.
What's New in Solaris System Tuning in the Solaris 10 Release?This section describes new or changed parameters in the Solaris 10 release. Default Stack SizeA new parameter, default_stksize, specifies the default stack size of all threads, kernel or user. The lwp_default_stksize parameter is still available, but it does not affect all kernel stacks. If default_stksize is set, it overrides lwp_default_stksize. For more information, see default_stksize. System V IPC ConfigurationIn this Solaris release, all System V IPC facilities are either automatically configured or can be controlled by resource controls. Facilities that can be shared are memory, message queues, and semaphores. Resource controls allow IPC settings to be made on a per-project or per-process basis on the local system or in a name service environment. In previous Solaris releases, IPC facilities were controlled by kernel tunables. You had to modify the /etc/system file and reboot the system to change the default values for these facilities. Because the IPC facilities are now controlled by resource controls, their configuration can be modified while the system is running. Many applications that previously required system tuning to function might now run without tuning because of increased defaults and the automatic allocation of resources. The following table identifies the now obsolete IPC tunables and the possible resource controls that could be used as replacements. An important distinction between the obsolete IPC tunables and resource controls is that the IPC tunables were set on a system-wide basis and the resource controls are set on a per-project or per-process basis.
* Note that the project.max-shm-memory resource control limits the total amount of shared memory of one project, whereas previously, the shmsys:shminfo_shmmax parameter limited the size of a single shared memory segment. For more detailed descriptions of the resource controls, see Available Resource Controls in System Administration Guide: Solaris Containers-Resource Management and Solaris Zones. Obsolete parameters can still be included in the /etc/system file on a Solaris system. If so, the parameters are used to initialize the default resource control values as in previous Solaris releases. For more information, see Parameters That Are Obsolete or Have Been Removed. However, using the obsolete parameters is not recommended. The following related parameters have been removed. If these parameters are included in the /etc/system file on a Solaris system, the parameters are commented out.
For the current list of available resource controls, see rctladm(1M). For information about configuring resource controls, see project(4), and Chapter 6, Resource Controls (Overview), in System Administration Guide: Solaris Containers-Resource Management and Solaris Zones. NFSv4 ParametersThe following parameters for the NFSv4 protocol are included in this release: For information about NFSv4 parameters, see NFS Module Parameters. New and Changed TCP/IP ParametersThe following IP parameters have been added in this Solaris release: The following TCP parameters are new in this Solaris release: The following TCP/IP parameters are obsolete in this Solaris release.
IP Forwarding ChangesIn this Solaris release, IP forwarding is enabled or disabled by using the routeadm command or the ifconfig commands instead of setting the following tunable parameters with the ndd command:
Using the routeadm command and the ifconfig command instead of the ndd command to set IP forwarding provides the following advantages:
To enable IPv4 or IPv6 packet forwarding on all interfaces of a system, you would use the following commands:
To disable IPv4 or IPv6 packet forwarding on all interfaces of a system, you would use the following commands:
In previous Solaris releases, you would enable IPv4 or IPv6 packet forwarding on all interfaces of a system as follows:
In previous Solaris releases, you would disable IPv4 or IPv6 packet forwarding on all interfaces of a system as follows:
If you want to enable IP forwarding on a specific IPv4 interface or IPv6 interface, you would use syntax similar to the following for your interface. The bge0 interface is used an as example.
If you want to disable IP forwarding on a specific IPv4 interface or IPv6 interface, you would use syntax similar to the following for your interface. The bge0 interface is used an as example.
Previously, IP forwarding was enabled on a specific interface as follows:
Previously, IP forwarding on a specific interface was disabled as follows:
If you want any of the preceding routeadm settings to take effect on the running system, use the following command:
For more information, see routeadm(1M) and ifconfig(1M). SPARC: Translation Storage Buffer (TSB) ParametersNew parameters for tuning Translation Storage Buffer (TSB) are included in this release. For information about TSB parameters, see sun4u or sun4v Specific Parameters. SCTP Tunable ParametersStream Control Transmission Protocol (SCTP), a reliable transport protocol that provides services similar to the services provided by TCP, is provided in this Solaris release. For more information about SCTP tunable parameters, see SCTP Tunable Parameters. Tuning a Solaris SystemThe Solaris OS is a multi-threaded, scalable UNIX® operating system that runs on SPARC and x86 processors. It is self-adjusting to system load and demands minimal tuning. In some cases, however, tuning is necessary. This book provides details about the officially supported kernel tuning options available for the Solaris OS. The Solaris kernel is composed of a core portion, which is always loaded, and a number of loadable modules that are loaded as references are made to them. Many variables referred to in the kernel portion of this guide are in the core portion. However, a few variables are located in loadable modules. A key consideration in system tuning is that setting system parameters (or system variables) is often the least effective action that can be done to improve performance. Changing the behavior of the application is generally the most effective tuning aid available. Adding more physical memory and balancing disk I/O patterns are also useful. In a few rare cases, changing one of the variables described in this guide will have a substantial effect on system performance. Remember that one system's /etc/system settings might not be applicable, either wholly or in part, to another system's environment. Carefully consider the values in the file with respect to the environment in which they will be applied. Make sure that you understand the behavior of a system before attempting to apply changes to the system variables that are described here. We recommend that you start with an empty /etc/system file when moving to a new Solaris release. As a first step, add only those tunables that are required by in-house or third-party applications. Any tunables that involve System V IPC (semaphores, shared memory, and message queues) have been modified in the Solaris 10 release and should be changed in your environment. For more information, see System V IPC Configuration. After baseline testing has been established, evaluate system performance to determine if additional tunable settings are required. The tunable parameters described in this book can and do change from Solaris release to Solaris release. Publication of these tunable parameters does not preclude changes to the tunable parameters and their descriptions without notice. Tuning Format of Tunable Parameters DescriptionsThe format for the description of each tunable parameter is as follows:
Tuning the Solaris KernelThe following table describes the different ways tunable parameters can be applied.
/etc/system FileThe /etc/system file provides a static mechanism for adjusting the values of kernel parameters. Values specified in this file are read at boot time and are applied. Any changes that are made to the file are not applied to the operating system until the system is rebooted. Prior to the Solaris 8 release, /etc/system entries that set the values of parameters were applied in two phases:
The second phase sometimes caused confusion to users and administrators by setting parameters to values that seem to be impermissible or by assigning values to parameters (for example, max_nprocs) that have a value overridden during the initial configuration. Starting in the Solaris 8 release, one pass is made to set all the values before the configuration parameters are calculated. Example—Setting a Parameter in /etc/systemThe following /etc/system entry sets the number of read-ahead blocks that are read for file systems mounted using NFS version 2 software.
Recovering From an Incorrect ValueMake a copy of the /etc/system file before modifying it so that you can easily recover from incorrect value. For example:
If a value specified in the /etc/system file causes the system to become unbootable, you can recover with the following command:
This command causes the system to ask for the name of various files used in the boot process. Press the Return key to accept the default values until the name of the /etc/system file is requested. When the Name of system file [/etc/system]: prompt is displayed, type the name of the good /etc/system file or /dev/null:
If /dev/null is specified, this path causes the system to attempt to read from /dev/null for its configuration information. Because this file is empty, the system uses the default values. After the system is booted, the /etc/system file can be corrected. For more information on system recovery, see System Administration Guide: Basic Administration. kmdb Commandkmdb is a interactive kernel debugger with the same general syntax as mdb. An advantage of interactive kernel debugger is that you can set breakpoints. When a breakpoint is reached, you can examine data or step through the execution of kernel code. kmdb can be loaded and unloaded on demand. You do not have to reboot the system to perform interactive kernel debugging, as was the case with kadb. For more information, see kmdb(1). mdb CommandStarting with the Solaris 8 release is the modular debugger, mdb, is unique among Solaris debuggers because it is easily extensible. A programming API is available that allows compilation of modules to perform desired tasks within the context of the debugger. mdb also includes a number of desirable usability features, including command-line editing, command history, built-in output pager, syntax checking, and command pipelining. mdb is the recommended post-mortem debugger for the kernel. For more information, see mdb(1). Example—Using mdb to Change a ValueTo change the value of the integer parameter maxusers from 495 to 512, do the following:
Replace maxusers with the actual address of the item to be changed, as well as the value the parameter is to be set to. For more information on using the modular debugger, see the Solaris Modular Debugger Guide. When using either kmdb or mdb debugger, the module name prefix is not required. After a module is loaded, its symbols form a common name space with the core kernel symbols and any other previously loaded module symbols. For example, ufs:ufs_WRITES would be accessed as ufs_WRITES in each debugger (assuming the UFS module is loaded). The ufs: prefix is required when set in the /etc/system file. Special Solaris tune and var StructuresSolaris tunable parameters come in a variety of forms. The tune structure defined in the/usr/include/sys/tuneable.h file is the runtime representation of tune_t_fsflushr, tune_t_minarmem, and tune_t_flkrec. After the kernel is initialized, all references to these variables are found in the appropriate field of the tune structure. Various documents (for example, previous versions of Solaris System Administration Guide, Volume 2) have stated that the proper way to set parameters in the tune structure is to use the syntax, tune:field-name where field-name is replaced by the actual parameter name listed above. This process silently fails. The proper way to set parameters for this structure at boot time is to initialize the special parameter that corresponds to the desired field name. The system initialization process then loads these values into the tune structure. A second structure into which various tunable parameters are placed is the var structure named v. You can find the definition of a var structure in the /usr/include/sys/var.h file. The runtime representation of variables such as autoup and bufhwm is stored here. Do not change either the tune or v structure on a running system. Changing any field in these structures on a running system might cause the system to panic. Viewing Solaris System Configuration InformationSeveral tools are available to examine system configuration information. Some tools require superuser privilege. Other tools can be run by a non-privileged user. Every structure and data item can be examined with the kernel debugger by using mdb on a running system or by booting under kmdb. For more information, see mdb(1) or kadb(1M). sysdef CommandThe sysdef command provides the values of System V IPC settings, STREAMS tunables, process resource limits, and portions of the tune and v structures. For example, the sysdef “Tunable Parameters” section from on a 512-Mbyte SunTM UltraTM 80 system is as follows:
For more information, see sysdef(1M). kstat Utilitykstats are data structures maintained by various kernel subsystems and drivers. They provide a mechanism for exporting data from the kernel to user programs without requiring that the program read kernel memory or have superuser privilege. For more information, see kstat(1M) or kstat(3KSTAT). Note – kstat data structures with system_pages name in the unix module do not report statistics for cachefree. cachefree is not supported, starting in the Solaris 9 release. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||