Network Performance Issues

"What can I do to speed up my LAN?"  A very common question, and
one to which there is unfortunately, no cut and dried answer.
Network performance depends on many things: to get the best
performance out of your particular installation may require a
little experimentation.  This bulletin presents a discussion of
some of the major factors that affect performance, and a few
general suggestions for improvement.

                      Choosing your Hardware

When you're choosing the hardware for your LAN, keep in mind that
the things that make a fast computer are also the basic
ingredients of a fast network.  A fast processor, fast memory and
a fast disk drive all help to provide better network speed. For
best performance, you should choose fast, well balanced
components. The two biggest factors are CPU speed and hard disk
speed. 

It's fairly easy to find fast computers and fast disk drives out
there in the marketplace, but for the best results make sure that
the components you buy are well matched. If you install a high
performance disk drive in a 4.77 Mhz XT, your network will be slow
because the computer's CPU won't be able to move data  around fast
enough to keep up with the drive, let alone the rest of the
network. Similarly, if you install an old 20mb MFM drive in your
386-33, the fast processor will spend a lot of time waiting around
for the old drive, as will the rest of your network users.

The transmission speed of the adapter cards you choose will also
make a difference.  With reasonably fast machines, upgrading from
a LANtastic 2mbps adapter to a new AE-2 Ethernet adapter can
approximately double the throughput of the network.  Again,
balance is vital. If you have a slow processor, switching to
Ethernet may not make much difference -- the 2mbps adapter has a
coprocessor that handles all the low level NetBIOS processing,
whereas the Ethernet adapter relies on the computer to handle
everything.   


                 Optimizing Software Performance

Now that we've dealt with hardware selection -- the easy stuff --
let's see what can be done to improve the performance of existing
installations. First, let's tie down what we mean by the "speed"
of the LAN. There are really two things at issue here, the
physical transmission speed of the hardware, and the effective
throughput, or how fast data gets from one place to another on the
LAN. Assuming for now that the hardware is fixed and immutable,
here are some suggestions for getting the best throughput with
your particular application.


General Improvements

One thing that can improve performance on most networks is running
the DOS FASTOPEN command on the server if you have DOS 3.3 or
higher.  FASTOPEN tracks of the location of frequently used files
and directories and greatly decreases the amount of time it takes
to open files. 

Adding a disk cache to the server also helps performance in almost
all situations. Disk caching programs work by storing frequently
requested information in memory. This reduces the number of
physical accesses to the disk. Since accessing memory is almost
always faster than accessing the disk drive, can greatly improve
the disk performance of your network.  

The LANtastic disk caching program LANcache, is specifically
designed to work with LANtastic networks. It caches disk writes as
well as disk reads and when it actually does have to write to the
disk, it does so as a background operation so that CPU operations
can continue.  

                Choosing the Best Buffer Settings

Beyond these general speedups, getting the best performance out of
your specific application is a matter of fine tuning several
parameters. LANtastic has four sets of buffers, each of which can
affect performance in specific situations.  


Redir Buffers

It takes the network about the same amount of time to send 1 byte
of data as it does to send 256 bytes of data.  Every packet sent
over the network takes time to construct and time to process.
Given this, it makes sense to include as much data as possible in
each packet  -- it keeps the overhead's impact to a minimum and
reduces network traffic. The REDIR program accomplishes this by
buffering network requests at each machine. Here's an example of
REDIR's buffering in action: 

You are creating a file of customer names on the server and adding
data to it. You type in the names one at a time and your program
writes the names to the data file one at a time.  Rather than
issue a network send for each name, the data gets stored in the
local REDIR buffer until you close the file or fill the buffer.
At that point, REDIR issues a single request to send the entire
buffer.

Say you had to enter 100 names at 10 characters each. If each name
was sent individually, 100 network sends would be required. With
its default settings however, REDIR buffers the names and has to
make just one send! The time savings can be substantial.

REDIR buffers read requests similarly. If you request an amount of
data smaller than the REDIR buffer, REDIR requests one buffer full
of data from the server. Then, if you request the next sequential
piece of data, REDIR can supply it to your program without even
making a network request.

If you read or write blocks of data larger than the REDIR buffer,
the network software bypasses it and deals directly with the
NetBIOS. The ideal REDIR buffer size then, would be about the
average size of the packets that your network typically sends and
receives. You can set the size of the REDIR buffers with the SIZE=
command line switch.

The number of REDIR buffers can also affect the performance of
many applications. If you allocate multiple REDIR buffers using
the BUFFERS= command line switch, the network tries to associate
each one with a file handle. Network printers are handled just
like other files.  Ideally, you should have a buffer available for
each open network file. If you have more files than available
buffers, the network flushes the least recently used buffer and
assigns it to the new request.

WordPerfect is a good example of a program that is affected by the
number of buffers.  If you have only one buffer allocated,
printing can be very slow because WP has to read the document and
send data to the printer with the same buffer. The poor buffer
gets continually filled and flushed, back and forth, with printer
data and document data. In this situation, allocating just one
more buffer allows WP to use one buffer for document reading and
another for printing. 


Server Buffers and Tasks

A server buffer is at the other end of a REDIR buffer. When, for
example, a workstation makes a read request, the server reads one
server buffer full of data, beginning with the information
requested.  If the workstation then asks for the next piece of the
same information, the server can get it from the buffer instead of
physically reading the hard disk.

The server buffer size can be changed from the Server Startup
Parameters option in the NET_MGR program. Be aware that bigger
isn't necessarily better -- as with REDIR buffers, the optimal
size is somewhere around the average size of the packets that will
be transferred across the network by your application.  One server
buffer of whatever size you select is allocated for each network
task.

When a workstation submits a request to a server, the server will
work on the request for a while, then switch to work on the next
task for a while, and so on, in a round-robin fashion.  If the
server is set up with only one network task, instead of switching,
the server will run the request to completion and other incoming
tasks will be queued up behind it.  From the user's standpoint,
the station that submitted the first request will get very good
performance, and everyone else will be kept waiting.  In general,
allowing more than one network tasks will ensure that everyone's
requests get processed and will result in "smoother" network
performance.

If you're a using network adapter with a coprocessor, like our
Enhanced 2mbps adapter, increasing the number of network tasks
(with the Server Startup Parameters option of NET_MGR) will give
you a big performance boost. While the coprocessor is busy working
on one task, the server's CPU can work on another.  This advantage
is multiplied if you have more than one coprocessor equipped
adapter in a server.  In fact, with three or four 2mbps boards in
a dedicated server and a corresponding number of network tasks,
you can achieve a continuous throughput comparable to that of an
Ethernet network with an equal number of stations. As a plus,
you've got built-in redundancy -- the workstations connected to
each adapter will function as separate networks. If one segment
fails because of cabling or adapter problems, the rest will still
operate.


Printer Buffers

As with REDIR and server buffers, increasing the size of your
printer buffers can improve printing speed.  If your server has
more than one printer attached, increasing the number of printer
tasks will allow it to print to more than one printer
simultaneously. 

NetBIOS Buffers and Adapter Memory 

If your network is very active, try increasing the number of
buffers used by your adapter's NetBIOS. This will decrease the
size of the packet of data that your adapter will send and can
increase the speed with which your network handles user requests.
With LANBIOS or LANBIOS2, you can do this with the BUFFERS=
command line switch.  With AE-2, NE-3 and other Ethernet drivers
for AI-LANBIOS, use the PACKET_SIZE= switch.  If your network
doesn't have a lot of contention, you can decrease the number of
NetBIOS buffers so that the server can process larger blocks of
data. 

With our AE-2 card, there's an easy way to get a performance boost
on heavily loaded networks.  You can upgrade the adapter from its
default 16K configuration to a full 64K of RAM.  The chips can be
purchased direct from Artisoft, or you can use chips that meet the
specifications in the AE-2 manual.


Effects of Changing Buffer Sizes

Keep in mind that on systems with only two or three stations,
changing the buffer configuration may not have any measureable
impact on speed.  In any case, increasing the size and number of
REDIR and SERVER buffers uses memory and can slow down programs
running on the server. If your application performance is
critical, consider setting up a dedicated server for your most
used application programs and printers.

Running applications on the server

To get the best performance out of your network when you run
applications on a server, you should always use the server as
though it was a remote workstation: log in and access the
application through network drives. Using the server locally,
without logging in, places you in contention with the rest of the
users and network performance can suffer. If you log in, the
server will schedule you along with the rest of the network users
and everyone will get good performance.
 
Increasing print speed

One of the slowest things about printing to a network printer is
spooling to the hard disk.  With LANtastic NOS 3.0 you can easily
increase the print spooling speed by spooling to a RAM disk.  To
change the spooler's location, use the Change Spool Location
option of NET_MGR's Queue Maintenance function.  You can set the
spool location to any drive -- your RAM disk or even a fast drive
on your main server.  

