From: avonruff@urbana.mcd.mot.com (Al Von Ruff)
Subject: Re: Unix System Crashing!! Why?
Organization: Motorola Computer Group, Urbana Design Center
Date: Mon, 9 Nov 1992 19:51:45 GMT

In article <900@dsbc.icl.co.uk> mbm@dsbc.icl.co.uk (Malcolm Mladenovic) writes:

>>1) strthresh is tuned too low for your system use. If your machine
>>   crashes at approximately the same time of day (i.e: during backups,
>>   while sending/receiving news, during high UUCP traffic, running heavy
>>   networking loads), then this is probably the case. strthresh is a
>>   kernel tunable which designates the maximum number of bytes which
>>   the STREAMS subsystem is allowed to use. This parameter has a
>>   notoriously low default setting (around 2 Megabytes). I would recommend
>>   setting strthresh to a value of 50 percent of physical memory.
>
>This seems an unnecessarily high a value for large configurations - the machine
>that I'm posting from has strthresh set to 4MB.  It is a dual processor sparc
>running svr4 with 128MB of physical memory.  The machine is regularly running
>with large amounts of networking traffic but no STREAMS resources problems.
>This ought to be sufficient unless you are running with many TCP connections
>doing bulk data transfer at the same time.  [It doesn't actually do any harm
>to have a large value, if you do have a problem it will increase the length
>of time the system stays up, though performance will degrade over time since
>less and less memory will be available for the buffer cache and other uses.]

I have found that the strthresh setting required for a particular installation
depends greatly on the type of use encountered. The 50 percent setting is 
actually quite close to USL's suggested setting:

	"STRTHRESH should be set to about 1/4 to 1/2 of the total system
	memory. The default of 2000000 (approximately 2 megabytes) is a
	good maximum for a 4 megabyte system."

The above is from the "Tunable Parameters" section of the SAG (chapter 10).

In practice, I have found that 2 Meg is sufficient for single user systems,
or systems with light multi-user loads. I have found that 4 Meg is sufficient
for most other multi-user systems  - but I have seen several notable exceptions.

For instance, our main source configuration backbone (A quad 88K with 64 MB of
physical memory) has a typical average load of 300 to 600 processes, about 80 
to 100 users, with file systems NFS mounted via T1 link to somewhere between 
40 to 60 remote hosts. This system has an extremely high STREAMS usage profile, 
and 4 Meg of STREAMS buffers is simply inadequate.

I have also observed a dual CPU system with 128 MB with four modems (lots of
ldterms and STREAMS-based tty drivers) connected to uunet (serving as
a UUCP hub) die of resource starvation unless strthresh was boosted well 
past 8 MB.

As you stated, there isn't any penalty for configuring "too much" STREAMS
resources (as long as you stay well below physical memory limits). The real
drawback that I have seen is that it prolongs system death in cases where
real problems exist, dragging out the debug time for that particular problem.
As you also stated, these systems are usually pretty easy to identify due
to their dog-slow performance.

>    ....  If Strcount increases over time
>with no corresponding change in the system workload you probably have a
>memory leak in either the STREAMS subsystem itself or in one of the STREAMS
>modules or drivers.   If this is the case you need to report the problem
>to your vendor.  It may also aloow you to do planned, clean reloads at a more
>convenient time than just when the system locks up.

Agreed.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Al von Ruff             Motorola Microcomputer Division, Urbana Design Center
Voice:  217.384.8553        1101 East University Avenue, Urbana, IL 61801 USA
Internet:  avonruff@urbana.mcd.mot.com         UUCPnet:  uiucuxc!udc!avonruff
Newsgroups: comp.unix.sys5.r4