[Return to Library] [Contents] [Previous Chapter] [Next Section] [Next Chapter] [Index] [Help]


3    Tuning Subsystem Operations

This chapter describes how you can tune your system to use resources most efficiently under a variety of system load conditions. Tuning your system can include changing system configuration file parameters or sysconfigtab attributes, increasing resources such as CPU or cache memory, and changing the system configuration, such as adding disks, spreading out file systems, or adding swap space.

Note

If you have a performance problem on your system, never attempt to tune your system until you have confirmed that the problem is not caused by an application that is either broken or in need of further optimization. For information on application optimization, see the Programmer's Guide.

As a general rule, performance tuning consists of performing several of the following tasks:

Section 3.3 explains the mechanisms that you can use to tune your system.


[Return to Library] [Contents] [Previous Chapter] [Next Section] [Next Chapter] [Index] [Help]


3.1    Analyzing Tuning Possibilities

Prior to tuning your system, you need to understand how your system is being used. For example, is your system used primarily as a file server? Are users running many small applications or are they running mostly large applications? Without this understanding, your attempts at tuning may cause more harm than good. If you understand the system's intended use and you perceive a performance problem, keep the following tuning rules in mind:

The following text provides an example of an analytical path you could follow to determine where your system needs tuning - after first confirming that your applications are not causing the performance problem:

  1. Is there enough memory? Use the vmstat command to display information about virtual memory.

    Check the number of pages on the free list. If the number is less than 128, you may have a virtual memory problem. Possible solutions to a virtual memory problem include the following:

  2. Is there enough CPU? Use the vmstat command to determine how the applications are using CPU resources:

  3. Is your system paging excessively? Use the vmstat command to check for a high page-out rate (pout). Your system may have a virtual memory problem if it is paging excessively.

  4. Do you have excessive disk I/O? Use the iostat command to determine which disks are being used the most. Spread out your swap space across several disks. Spread out file systems across disks.

  5. Do you have a large number of network retransmissions or dropped packets? You may have a problem in your network. Use the netstat command with the -i and -s options to produce statistics that will help you to analyze input and output problems. Use the nfsstat -c command to obtain information about NFS retransmissions.

After you determine where your performance problem exists, you can then begin your effort to remedy it. The following sections describe the various tuning possibilities.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.2    Optimizing CPU Utilization

When applications are operating correctly but are experiencing CPU saturation (that is, a lack of available CPU cycles), your options for correcting the situation are limited. If the CPU overload condition is expected to continue indefinitely, the best long-term solution is to add more memory, add an additional processor (on multiprocessor systems), or replace your system with a larger one. In the short term, before you are able to increase CPU capacity, you can make a number of adjustments to temporarily increase performance on a system that is compute bound.

The following sections describe the effects of expanding CPU capacity on a Symmetrical Multiprocessing system (SMP) (Section 3.2.1) and temporary changes that you can make to reduce CPU load (Section 3.2.2).


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.2.1    Expanding CPU Capacity on an SMP System

SMP systems allow you to expand the computing power of a system by adding additional processors. In most cases, increasing computing power in this way improves the performance of a system. Adding additional processors can be an effective solution for performance problems on SMP systems that are compute bound (only nominal idle time) and have multiple processes with the ability to run concurrently. Note that your system's ability to take advantage of the increase in computing capacity provided by additional processors may be limited if you do not also increase your system's I/O capacity.

Workloads that lend themselves well to SMP include DBMS servers, mail servers, and compute servers, to name a few. Basically, most workloads that have multiple processes or multiple threads of execution that can run concurrently can benefit from SMP. It is important to note that the gating factor for these workloads in some cases is not computing power, and these types of workloads may require additional tuning. For example, workloads that are metadata intensive and that involve a limited number of directories may benefit more if NVRAM is also added to your system whenever an additional processor is added. (Metadata intensive applications open large numbers of small files and access them repetitively.)

The operating system is designed to ensure that the user load is balanced across the available processors. Factored into the load-balancing algorithm are the user load, system load, and the interrupt rate. The algorithm is tuned to attempt to allow threads that have recently run on a given processor to continue to run on that processor (to take advantage of data retained in caches). Users can optionally choose to bind a particular process to a particular processor. This can be done using either the runon command or the bind_to_cpu system call. See runon(1) or bind_to_cpu(3) for details.

The utilities iostat and vmstat allow you to monitor the memory, CPU, and I/O consumption on your system. The cpustat extension to kdbx also allows application developers to monitor the time spent in user mode, system mode, and kernel mode on each of the processors. This information can help application developers determine how effectively they are achieving parallelism across the system. To enhance parallelism, application developers working in Fortran or C should consider using the Kuch & Associates Preprocessor (KAP), which can have a significant impact on SMP performance. See the Programmer's Guide for details on KAP.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.2.2    Short-Term Adjustments to Reduce CPU Load

In general, the following adjustments can be made to improve CPU processing on a temporary basis:

The system vnode table limits the number of active files. If your system is heavily loaded but does not have a shortage of memory, increasing the size of the system vnode table may improve performance. You can increase its size by giving a higher value to the maxusers attribute.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.3    Methods of Tuning System Parameters

System parameters are global variables that you can tune in a variety of ways:

The latter method is preferred because it requires only a system reboot to put new values permanently into effect; whereas, using the other methods is either only a temporary solution (dbx method) or requires a kernel rebuild and a system reboot (system configuration file or param.c method). Kernel rebuilds can be difficult and time consuming and should be avoided whenever possible.

Using the attribute method entails establishing attribute values by interacting with the Kernel Tuner (dxkerneltuner) provided by the Common Desk Environment's (CDE) graphical user interface or by issuing the sysconfigdb or sysconfig -r commands from a terminal window:

As indicated earlier in this section, the value of a global variable can be reset by a variety of mechanisms. As a result, global variables in the system configuration file and the param.c file can have values that differ from those of their corresponding attributes in the sysconfigtab file. To understand how one value of a global variable is overridden by another, it is necessary to understand the levels at which global variables are controlled in a system. From lowest to highest, the control levels are as follows:

Each global variable can have a different value at each level of control. As a result, the following precedence rules, from highest to lowest, apply in a running system:

See Section 2.2.9 for information on how to monitor the values of configuration attributes. For descriptions of the tunable configuration attributes in sysconfigtab, see Appendix B. (Note that not all subsystems displayed by a sysconfig -r command are covered in Appendix B. Only those subystems that have tunable attributes affecting performance are covered.)


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.4    Tuning Memory

The memory subsystem is one of the first places where a performance problem can occur. Performance can be degraded when the virtual memory subsystem cannot keep up with the demand for pages.

Memory tuning can be divided into the following two areas of concern:

Table 3-1 lists some sysconfigtab attributes that can have a significant impact on virtual memory, including paging and swapping, and the UBC. Reboot the system if you change any of these attributes.

Table 3-1: Configuration Attributes and Parameters Used to Tune Memory

Attribute/Parameter Default Description
Parameters:    
dfldsiz 134217728 Default data segment size limit.
dflssiz 1048576 Default stack size limit.
maxdsiz 1073741824 Maximum data segment size limit.
maxusers 32 See maxusers attribute.
Attributes:    
bufcache 3 Percentage of memory dedicated to the file system buffer cache.
buffer-hash-size 512 The size of the buffer cache hash chain table used to store the heads of the hashed buffer queues.
max-proc-per-user 64 Maximum number of processes one user can run simultaneously.
maxusers 32 Number of users the system can support simultaneously.
msg-mnb 16384 Maximum number of bytes on a System V message queue.
msg-mni 50 Number of System V message queue identifiers.
msg-tql 40 Number of System V message headers.
name-cache-hash-size 256 The size of the hash chain table for the namei cache.
ubc-borrowpercent 20 The percentage of physical memory above which the UBC is borrowing memory from the system.
ubc-maxpercent 100 Maximum percentage of memory that the UBC can consume.
ubc-minpercent 10 Percentage of memory at which page stealing from the UBC is prohibited.
vm-aggressive-swap 0(off) Controls whether the task swapper should be more aggressive in swapping out idle tasks to prevent the system from reaching a low-memory condition.
vm-asyncswapbuffers 4 The total number of asynchronous I/O requests by the page stealing daemon that can be outstanding, per swap partition, at any one time.
vm-clustermap 1024*1024*1 Cluster duplication map size.
vm-clustersize 1024*64 Maximum cluster duplication for each bp.
vm-cowfaults 4 Copy point.
vm-csubmapsize 1024*1024 Size of kernel copy map. (The kernel copy map is the address space for copying data into and out of the kernel.)
vm-heappercent 7 Percent of kernel virtual address space to allocate for use by the heap.
vm-inswappedmin 1 Minimum number of inswapped ticks (in seconds) that must occur before a task can be swapped out.
vm-mapentries 200 Maximum number of virtual memory map entries that a user map can have. Map entries are allocated when the user maps an object into address space that is not adjacent to another object that has the same protection and that can grow.
vm-maxvas 1L<<30 Maximum virtual address space for user maps (see vm-mapentries).
vm-maxwire 1L<<24 Maximum amount of memory that can be wired by a user process.
vm-page-free-min 20 The free list's low watermark (below which physical memory reclamation begins).
vm-page-free-optimal 74 A value for pages on the free list that can cause the system to swap out entire tasks to reduce memory demand.
vm-page-free-reserved 10 The number of pages on the free list that are reserved for the kernel.
vm-page-free-target 128 The free list's high watermark (above which physical memory reclamation stops).
vm-page-prewrite-target 256 The number of pages that the virtual memory subsystem attempts to keep clean.
vm-segmentation 1(on) Enables shared page tables.
vm-syncswapbuffers 128 Number of synchronous swap buffers.
vm-syswiredpercent 80 Maximum percentage of system-wide wired memory.
vm-ubcbuffers 256 Minimum number of buffers that the UBC can contain.
vm-ubcdirtypercent 10 Maximum percentage of UBC pages that can be modified ("dirtied").
vm-ubcpagesteal 24 Number of pages that the UBC can have for a file before the UBC will begin to take pages from the file to satisfy the file's own demands.
vm-ubcseqpercent 10 The size of a file as a percentage of the UBC.
vm-ubcseqstartpercent 50 The size of the UBC as a percentage of total memory.
vm-vpagemax 16384 The maximum number of individually protected pages in a user address space.
vm-zone_size 67108864 Amount of kernel virtual address space that is available for many of the system's dynamic data structures.

Detailed descriptions of the attributes are provided in Section B.21. For information about the parameters listed in the table, see the manual System Administration.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.4.1    UBC Subsystem

In some cases, an I/O-intensive process may degrade the performance of other processes by using a major portion of the UBC. If you need more memory for the virtual memory subsystem, you can reduce the amount of memory that is available to the UBC. Note that reducing the memory available to the UBC may adversely affect file system I/O because less file system data will be cached in the UBC and increasing amounts of data will have to be accessed from disk.

The UBC is flushed by the update daemon. UBC statistics can be viewed by using dbx and checking the vm_perfsum structure. You can also monitor the UBC by using the dbx -k command and examining the ufs_getapage_stats kernel data structure.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.4.1.1    Changing the Size of the UBC

The size of the UBC is influenced by the values of the following configuration attributes in the sysconfigtab file:

ubc-maxpercent
Defines the maximum amount of physical memory that can be used for the UBC. The default is 100 percent of memory.

ubc-minpercent
Defines the minimum amount of physical memory allocation for the UBC. The default is 10 percent of memory.

ubc-borrowpercent
Defines the percentage of physical memory above which the UBC is borrowing memory from the system. When the system runs out of memory, the UBC is forced to give all borrowed memory back to the system before the system resorts to global page reclamation. The default is 20 percent of memory. (Note: It is much faster to free UBC pages than to perform global page reclamation because UBC pages are usually clean (unmodified) and can be freed without being written to disk.)

By default, the UBC will use at least 10 percent of all memory and can use up to 100 percent of all memory. If you want to reduce the amount of memory that can be allocated to the UBC, you could set ubc-maxpercent to 50 percent of all memory. This ensures that the UBC will not adversely affect the virtual memory subsystem. Note that the performance of an application that generates a lot of random I/O will not be improved by enlarging the UBC because the next access location for random I/O cannot be predetermined.

If vmstat output shows excessive paging but few or no page outs, the value of ubc-borrowpercent is probably set too low. It is particularly important to watch for this on low-memory systems (24-MB systems) because they tend to reclaim UBC pages much more aggressively than systems with more memory, and this condition can have an adverse effect on system performance.

Typically, the UBC borrows all physical memory above ubc-borrowpercent (up to the ubc-maxpercent limit). Increasing this value allows more memory to remain in the UBC before global page reclamation begins (that is, before the number of free pages in the system equals the value of the vm-page-free-min attribute). This typically increases the UBC cache effectiveness, but decreases the system response time when a low memory condition occurs. The range of values for this parameter is 0 to 100.

If the page-out rate is high and you are not using the file system heavily, you could decrease the value of ubc-maxpercent to reduce the rate of paging. Use the vmstat command to determine whether the system is paging excessively. Using dbx, periodically examine the vpf_pgiowrites and vpf_ubcalloc fields of the vm_perfsum kernel structure. The page-out rate may shrink if page outs greatly exceed UBC allocations.

For I/O servers, you may want to raise the value of the ubc-minpercent attribute in the sysconfigtab file to ensure that more memory is available for the UBC. If you do this, large programs that run occasionally will not completely fill the UBC. To check that you did not raise ubc-minpercent too high, use the vmstat command to examine the page-out rate.

If you change the values of the ubc-maxpercent and ubc-minpercent attributes in the sysconfigtab file, do not make the values so close together that you degrade I/O performance or cause the system to page excessively.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.4.1.2    Preventing UBC Cache Thrashing

The Digital UNIX operating system uses some configuration attributes in the sysconfigtab file to prevent a large file from completely filling the UBC, thus limiting the amount of memory available to the virtual memory subsystem. The system will reuse the pages in the UBC instead of taking pages from the free page list when both of the following conditions are met:

The vm-ubcseqstartpercent and vm-ubcseqpercent attributes in the sysconfigtab file are used to ensure that a large file does not take all of the pages on the free page list and cause the system to page excessively.

For example, using the default values, the UBC would have to be larger than 50 percent of all memory and a file would have to be larger than 10 percent of the UBC (that is, the file size would have to be at least 5 percent of all memory) in order for the system to reuse the pages in the UBC.

To determine the values of the vm-ubcseqstartpercent and vm-ubcseqpercent attributes, use the sysconfig -q command.

On large-memory systems that are doing a lot of file system operations, you may want to lower the vm-ubcseqstartpercent value to 30 percent. Do not specify a lower value unless you decrease the size of the UBC. You probably do not want to change the value of vm-ubcseqpercent.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.4.1.3    Tailoring Usage of Metadata and Namei Buffer Caches

Although all memory is shared between the virtual memory subsystem and the UBC, the file system code that deals with the UNIX file system's metadata - including directories, indirect blocks, and inodes - still uses the traditional BSD buffer cache. The following configuration attributes in the sysconfigtab file affect file system buffer cache usage:

To determine whether you should change the value of bufcache, use dbx to examine the bio_stats structure (see Section 2.2.10.5). The miss rate (block misses divided by the sum of the block misses and block hits) should not be more than 3 percent. If you have a high miss rate (low hit rate), you may want to raise the value of bufcache. Note that any additional memory that you allocate to the metadata buffer cache is taken away from the rest of the system. This may cause system performance to decline because it reduces the amount of memory that is available to the UBC and the virtual memory subsystem. In most cases, it is not advisable to modify the bufcache value. If you need to raise the value, never raise it to more than 10 percent.

You can decrease the value of bufcache on large memory systems if the hit rate is high and you want to increase the amount of memory that is available to the virtual memory subsystem.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.4.2    Virtual Memory Subsystem

Excessive paging, which is sometimes called thrashing, decreases performance. This means that the natural working set size has exceeded available memory. Because the virtual memory subsystem runs at a higher priority, it blocks out other processes and spends all system resources on servicing page faults for the currently running processes.

You can determine whether a system has memory problems by examining the output of the vmstat command. The pout column lists the number of page outs. The free column lists the amount of pages on the free page list. Less than 128 pages on the free page list and a consistently high number of page outs may indicate that excessive paging and swapping is occurring.

Some general solutions for reducing excessive paging and swapping are as follows:

See Table 3-1 for a list of parameters and attributes that can be used to tune virtual memory. Detailed descriptions of the attributes are provided in Section B.21. For information about the parameters listed in the table, see the manual System Administration.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.4.2.1    Modifying Your Swap Space Configuration

To optimize the use of your swap space, use your fastest disks for swap devices and spread out your swap space across multiple devices. Use the swapon -s command to display your swap space configuration. Use the iostat command to determine which disks are being used the most.

To ensure the best performance, place each swap partition on its own disk (instead of placing multiple swap partitions on the same disk). The page reclamation code uses a form of disk striping (known as swap space interleaving) so that pages can be written to the multiple disks. In addition, configure all of your swap devices at boot time to optimize swap space. See the manual System Administration for details on how to perform these operations.

To increase performance, you can change your swap mode from immediate mode (the default) to deferred mode (overcommitment mode) by removing or moving the /sbin/swapdefault file. Deferred mode requires less swap space than immediate mode and causes the system to run faster because less swap bookkeeping is required. However, because deferred mode does not reserve swap space in advance, the swap space may not be available when it is needed by a task and the process may be killed asynchronously. (See Appendix A for information about special considerations associated with low-memory systems (24-MB systems) operating in overcommitment mode.)

Application messages such as the following usually indicate that not enough swap space is configured into the system or that a process limit has been reached:

lack of paging space
swap space below 10 percent free

See the manual System Administration for information on how to fix these problems.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.5    Tuning Interprocess Communication

You may be able to improve IPC performance by tuning the following configuration attributes in the sysconfigtab file:

You can track the use of IPC facilities with the ipcs -a command (see ipcs(1)). By looking at the current number of bytes and message headers in the queues, you can then determine whether you need to increase the values of the msg-mnb and msg-tql attributes in the sysconfigtab file to diminish waiting.

You may also want to consider tuning several other IPC attributes in the sysconfigtab file. How you tune the following attributes depends on what you are trying to do in your application:


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.6    Tuning I/O

I/O tuning can be divided into the following three areas of concern:

The operating system includes several configuration parameters and attributes that can affect the I/O subsystem. As specified in Table 3-2, they are set in either the system configuration file or the sysconfigtab file or by using dbx. Reboot the system if you change any configuration parameters or attributes to place the new values in effect.

Table 3-2: Tunable I/O Subsystem Attributes and Parameters

Attribute/Parameter Default Description
Read parameters:    
cluster_consec_incr 1 The increment for determining the number of blocks that should be combined on the next read-ahead request after the first read-ahead request. (Set with dbx.)
cluster_consec_init 2 The number of blocks that should be combined for the first read-ahead request. See Section 3.6.1.2 for more details on this parameter. (Set with dbx.)
cluster_lastr_init -1 The number of contiguous reads that need to be detected before read-ahead is requested. The default value will start read-ahead on the very first contiguous read request. (Set with dbx.)
cluster_max_read_ahead 8 The maximum number of clusters that can be used in read-ahead operations. See Section 3.6.1.2 for more details on this parameter. (Set with dbx.)
cluster_read_all 1 This variable is either on (!= 0) or off (==0). By default (on), perform cluster read operations on nonread-ahead blocks and read-ahead blocks. If off, perform cluster read operations only on read-ahead blocks. See Section 3.6.1.2 for more details on this parameter. (Set with dbx.)
Write parameters:    
cluster_maxcontig 8 The number of blocks that will combined into a single write request. The default tries to combine eight 8K-byte blocks into a 64K-byte cluster. This variable controls all mounted UNIX file systems (UFS). See Section 3.6.1.2 for more details on this parameter. (Set with dbx.)
cluster_write_one 1 This variable is either on (!=0) or off (==0). By default (on), when a cluster needs to be written (that is, 64KB of data has been dirtied), but nonlogically contiguous blocks make up the cluster, just the contiguous data is written, leaving the remaining data. The remaining data may be combined into future cluster requests. If off, 64KB of data will be written regardless of the number of write requests required to do so. (Set with dbx.)
Other parameters that influence I/O:    
delay_wbuffers 0 This variable applies only to UFS. It is either on (!=0) or off (==0). By default (off), write-behind is turned on. If on, flushing full buffers to disk is delayed until a sync call is issued. See Section 3.6.1.2 for more details on this parameter. (Set with dbx.)
maxcontig parameter 8 The maximum number of contiguous blocks that will be laid out before forcing a rotational delay. (Set with tunefs or newfs.)
maxusers 32 See maxusers attribute.
rotdelay 4 The expected time (in milliseconds) to service a transfer completion interrupt and initiate a new transfer on the same disk. It is used to decide how much rotational spacing to place between successive blocks in a file. If zero, blocks are allocated contiguously. (Set with tunefs or newfs.)
Attributes that influence I/O:    
maxusers 32 The number of users that your system can support simultaneously without straining system resources. See Section 3.6.1 for more details on this attribute.
max-vnodes Varies The maximum number of vnodes that can be allocated on a system. On a 32-MB or larger system, the maximum is the number of vnodes that will fit into 5 percent of available memory; on a 24-MB system, the default is 1000. (Set in the sysconfigtab file.)
min-free-vnodes Varies The minimum number of free vnodes that will be kept on the free list. On a 32-MB or larger system, the default is the value of nvnode; on a 24-MB system, the default is 150. (Set in the sysconfigtab file.)
namei-cache-valid-time 1200 The amount of time, in seconds, that governs when vnodes are deallocated. (Set in the sysconfigtab file.)
open-max-hard 4096 Hard limit for the number of files that a process can have open at one time. (Set in the sysconfigtab file.)
open-max-soft 4096 Soft limit for the number of file descriptors that a process may have open. This value is the default for all processes, and it must be less than or equal to the value of open_max_hard. See Section 3.6.1.2 for more details on this parameter. (Set in the sysconfigtab file.)
vnode-age 120 The amount of time, in seconds, that a vnode is guaranteed to be kept on the free list before it is recycled. (Set in the sysconfigtab file.)

For information about the parameters listed in the table, see the manual System Administration. Detailed descriptions of the attributes are provided in Section B.8.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.6.1    Disk Subsystem

Disk throughput is the gating performance factor for most applications. Data transfers to and from disk are much slower than data transfers involving the CPU or main memory. As a result, configuring and tuning disk subsystems to maximize the efficiency of I/O operations can have a critical impact on an application's performance.

The size of the disk operation is also important. In doing I/O to a disk, most of the time is usually taken up with the seek followed by the rotational delay. This is called the access time. For small I/O requests, access time is more important than the transfer rate. For large I/O requests, the transfer rate is more critical than the access time. Access time is also important for workstation, timeshare, and server environments.

Most performance problems occur because of disk saturation, that is, because demands for disk I/O exceed the capacity of your system. Before you attempt to fix a disk saturation problem by tuning the UFS and the AdvFS file systems and the Common Access Method (CAM) subsystem, try to improve performance by making some of the following adjustments:

The following sections describe how to tune the Virtual File System (VFS), UFS, and AdvFS file systems and the CAM subsystem.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.6.1.1    Tuning the Virtual File System

Depending on system requirements, you can change Virtual File System (VFS) limits by tuning the following configuration attributes in the sysconfigtab file:

max-vnodes
min-free-vnodes
vnode-age
namei-cache-valid-time

Allocation and deallocation of vnodes is handled dynamically by the system using the values set for these four attributes. With the exception of namei-cache-valid-time, the values of all of these attributes can be changed with the sysconfig -r command while the kernel is executing. Tuning considerations associated with these configuration attributes are as follows:

If you need to optimize processing time, you can disable vnode deallocation by setting the value of the attribute vnode-deallocation-enable to zero (0). Disabling vnode deallocation increases memory usage because memory used by the vnodes is not returned back to the system.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.6.1.2    Tuning the UNIX File System

Use the dumpfs command to display file system information.

To tune the UNIX File System (UFS), you can use one or more of the following options and techniques:


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.6.1.3    Tuning the Advanced File System

The POLYCENTER Advanced File System (AdvFS) is a file system option available on the Digital UNIX operating system. It provides rapid crash recovery, high performance, and a flexible structure that enables you to manage your file system while the system is on line. Optional AdvFS utilities further enhance file system management capabilities. In particular, the defragment, stripe, and migrate utilities provide online performance tuning. The AdvFS utilities are available as a separately licensed layered product.

Methods for improving AdvFS performance include the following:


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.6.1.4    Tuning CAM

The operating system uses the Common Access Method (CAM) as the operating system interface to the hardware. CAM maintains pools of buffers that are used to perform I/O. Each buffer takes approximately 1KB of physical memory. You should monitor these pools and tune them if necessary.

The following attributes can be checked with the dbx debugger and modified in the param.c file or the sysconfigtab file:

If the I/O pattern associated with your system tends to have intermittent bursts of I/O operations (I/O spikes), increasing the values of the cam_ccb_pool_size and cam_ccb_increment attributes may result in improved performance. See Section 3.3 for information on how to modify param.c parameters or sysconfigtab attributes.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


3.6.2    Network Subsystems

Most resources used by the network subsystems are allocated and adjusted dynamically, so tuning is typically not an issue with the network itself. NFS tuning, however, can be critically important because NFS is the heaviest user of the network (see Section 3.6.3).

The one network subsystem resource that may require tuning is the number of network threads configured in your system. If the netstat -m command shows that the number of network threads configured in your system exceeds the peak number of currently active threads, your system may be configured with too many threads, thereby consuming system memory unnecessarily. To adjust the number of threads configured in your system, modify the netisrthreads attribute in the sysconfigtab file. Adjust the number downward to free up system memory.


Network performance is affected only when the supply of resources is unable to keep up with the demand for resources. Two types of conditions can cause this congestion to occur:

Neither of these problems are network tuning issues. In the case of a problem on the network, you must isolate the problem and fix it (which may involve tuning some other components of the system). In the case of an overloaded network (for example, when the kernel issues a can't get mbuf message on a regular basis), you must either redesign the network, reduce the number of network applications, or increase the physical memory (RAM). See the Network Programmer's Guide or the manual Network Administration for information on how to resolve network problems.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Chapter] [Index] [Help]


3.6.3    Network File System

The Network File System (NFS) shares the unified buffer cache with the virtual memory subsystem and local file systems. Much of what is described in Section 3.6.1.2 also applies to NFS. For example, adding more disks on a server and spreading the I/O across spindles can greatly enhance NFS performance.

Most performance problems with NFS can be attributed to bottlenecks in the file system, network, or disk subsystems. For example, NFS performance is severely degraded by lost packets on the network. Packets can be lost as a result of a variety of network problems. Such problems include congestion in the server, corruption of packets during transmission (which can be caused by bad electrical connections, noisy environments, babbling Ethernet interfaces, and other problems), and routers that abandon forwarding attempts too readily.

Apart from adjustments to the file system, network, and disk subsystems, NFS performance can be directly enhanced in the following ways:

Also, when evaluating NFS performance, be aware that NFS does not perform well if any file-locking mechanisms are in use on an NFS file. The locks prevent the file from being cached on the client.