Without a sufficient number of STREAMS resources for TCP/IP
and IPX/SPX, your system may suffer performance problems to
the point of complete inactivity (hanging).
Under previous releases of the SCO operating systems, the
system or network administrators tuned STREAMS resources
by adjusting the data block count for a particular class
of data block, depending on resource usage for that class.
Under SCO OpenServer Release 5.0.0, there are only three
parameters which are used to adjust a system's STREAMS
resources:
NSTRPAGES:
controls the total amount of physical
memory that can be made available for
messages. The kernel will dynamically
allocate up to NSTRPAGES of memory for
message and buffer headers and buffers.
STRSPLITFRAC:
is a percentage "high-water mark" of
NSTRPAGES. If more than STRSPLITFRAC
percent of NSTRPAGES is in use and a
suitable buffer is not available on
the free list, the kernel will try to
split a larger buffer for use, and will
only allocate more memory if this
fails. The default value is 80% for
STRSPLITFRAC. If you set this value
lower, STREAMS will use less memory:
large buffer splitting will occur
quicker than if STRSPLITFRAC were a
higher value. However, splitting the
buffers can induce rapid memory
fragmentation. Unallocated memory
fragments exist as small, uncontiguous,
chunks of memory which are unusable for
large buffers. The STREAMS daemon,
strd, manages STREAMS memory whenever
possible by coalescing and releasing
chunks of unallocated STREAMS memory
for use by large buffer requests.
NSTREAM:
controls the number of stream heads
available. One stream head is used
for each application running on your
system that uses STREAMS to establish
connections. Applications that use
stream pipes require two stream heads
per pipe. Each configured stream head
requires 80 bytes of memory; other
than this overhead, NSTREAM has no
effect on performance.
The mechanism to monitor STREAMS performance and resource
allocation is still the netstat(TC) command. Monitoring
STREAMS resources allows you to determine when to tune your
system for maximum performance for TCP/IP and IPX/SPX
protocols.
By running the command:
# netstat -m
you will get a report of STREAMS memory usage. The critical
column of data in the report is the 'fail' column.
streams allocation:
config alloc free total max fail
stream 3072 166 2906 4046 181 0
queues 908 383 525 9986 422 0
mblks 9828 9062 766 14212132 9680 0
buffer headers 9914 9723 191 490194 9840 0
class 1, 64 bytes 4608 4400 208 5153329 4568 0
class 2, 128 bytes 4608 4403 205 4602065 4599 0
class 3, 256 bytes 176 13 163 1935437 233 0
class 4, 512 bytes 40 8 32 746953 43 0
class 5, 1024 bytes 12 2 10 327388 36 0
class 6, 2048 bytes 134 111 23 426889 137 0
class 7, 4096 bytes 105 94 11 2656 105 0
class 8, 8192 bytes 6 0 6 2900 14 0
class 9, 16384 bytes 3 0 3 1450 3 0
class 10, 32768 bytes 0 0 0 0 0 0
class 11, 65536 bytes 0 0 0 0 0 0
class 12, 131072 bytes 0 0 0 0 0 0
class 13, 262144 bytes 0 0 0 0 0 0
class 14, 524288 bytes 0 0 0 0 0 0
total configured streams memory: 3024.00KB
streams memory in use: 1619.91KB
maximum streams memory used: 2249.61KB
If the 'fail' column for the 'streams' row is non-zero, this
indicates that the number of stream-heads configured needs to
be increased. This can be done by increasing the value of the
kernel parameter NSTREAM using the configure(ADM) command.
Please also note that NSTREAM should be set to at least 256 on
systems that mount NFS-filesystems or invoke remote X clients.
A program will not run if it cannot obtain a stream head and
will generate an error message:
NOTICE: {progname}: out of streams
Failures in the other rows, namely in the 'queues', 'mblks'
and 'buffer headers' rows (along with their corresponding
failures in the 'class' rows), may warrant additional kernel
tuning.
At the end of the 'netstat -m' command output is listed
STREAMS memory values. They are:
- 'total configured streams memory' --
indicates the upper limit of the amount of memory which
can be dynamically allocated for STREAMS usage.
- 'streams memory in use' --
the amount of memory currently in use by STREAMS
- 'maximum streams memory used' --
the maximum amount used since the system was booted
If there are several non-zero entries in the 'fail' column, and
the amount of 'streams memory in use' is almost the same as the
'total configured streams memory', then you should increase the
number of NSTRPAGES. NSTRPAGES controls the number of 4K pages
of memory that can be dynamically allocated for STREAMS use.
As a final note, STREAMS resource configuration is a process
which requires time, careful observation and analysis, and
planning by the System/Network Administrator. Increasing or
decreasing STREAMS parameters is system-dependent. A thorough
knowledge of your system, the user-process requirements, system
overhead requirements, and load (as a function of time)
requirements are only part of the variables which must be
factored into your decision when tuning STREAMS, or any kernel
resource, parameters.
SEE ALSO:
man pages for STREAMS, configure(ADM), netstat(TS)
"Sco OpenServer Performance Guide" (AU200004P000)
|