Technical article 112781

How can I see what files are in use with AFPS and how can I increase performance?

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6

Written · Last revised

Problem

I want to see what files are open and, using resource on my AFPS server, increase performance for my clients.

Cause

Depending on the load that AFPS is experiencing from the clients then this can affect the server performance.

The "lmx.srv" daemon is the client service process that handles Server Message Block (SMB) requests which uses "system" memory.

The "lmx.ctrl" process creates "lmx.srv" processes as needed; they respond to incoming SMB's from clients and requests from the lmx.ctrl process.

Each "lmx.srv" process services the needs of several client
computers on the network.  You can define how many clients
each "lmx.srv" process services in the
/usr/net/servers/lanman/lanman.ini file.

If too many server resources are being consumed it may be possible to spread the File and Print sharing load across a number of additional AFPS servers.

Solution

To see what files are being processed at any one time use the following:

(1a) Command Line Prompt

net session net statistics server net file /usr/net/servers/lanman/bin/srvstat /usr/net/servers/lanman/bin/lmstat -c and -C

More information can be seen by running the lmstat -c option with -p <pid> of the process id of the lmx process in question.

(1b) lsof
"lsof" is a Skunkware utility.  The latest version is available
from:
http://www.sco.com/skunkware

Download the tar file and extract it to a temporary directory. Then run "custom" to install the VOL.000.000 media image file from that directory.

Ensure your $PATH environment variable includes /usr/local/bin and then run:

lsof | egrep 'COMMAND|lmx.srv' | pg
For more information see "man lsof".  You may need to add the PATH
"/usr/local/man" to the MANPATH variable defined in /etc/default/man.
(2) lanman.ini changes

To increase the amount of buffer space to allocate to each "lmx.srv" process you will need to modify the /usr/net/servers/lanman/lanman.ini file and change or add the "[ lmxserver ]" and "[ server ]" sections as below:

[ lmxserver ]
gcbuffer=8192
hashsize=256
coreok=yes
maxfilesize=600000
dirbufsize=2048
Where "gcbuffer" is the buffer size in KBytes, allocated for each
server process for client files. The default is 100, the minimum is
one and the maximum is unlimited.  The value shown above is an
example for a busy server of approximately 1000 concurrent users.

The gcbuffer parameter (in the [lmxserver] section) represents the size (in KB) of a general workspace buffer allocated for each lmx.srv process. If an operation performed by an SMB work task within an lmx.srv process requires additional work space, it attempts to acquire that work space from this buffer.

Requests for additional workspace beyond the size specified in gcbuffer are not allowed. Increasing this parameter from the default of 100 provides a larger secondary work space buffer for the lmx.srv processes. In servers with very large workloads, performance can be improved. Use the following values as guidelines when adjusting this parameter:

------------------------------------------------------------
Number of   gcbuffer Value   gcbuffer Value   gcbuffer Value
Clients     Light Client     Medium Client    Heavy Client
------------------------------------------------------------
   75              750             1000             1500
  100             1000             1500             2000
  250             1250             1750             2500
  500             2500             3500             5000
  750             3750             5250             7500
 1000             5000             7000            10000
"hashsize" is the number of buckets for the hash table in shared
memory to keep track of the various modes that clients have used
to open files and set record locks.  The default is 128, the
minimum is 8, and the maximum is unlimited (powers of 2).
The hashsize parameter (in the [lmxserver] section) specifies the
number of buckets for the hash table in shared memory. This number
is used to keep track of the various modes that clients have used
to open files and set record locks. A ``bucket'' is an area of
memory.

Searches of the list of open file modes and record locks are performed much faster when a hash algorithm is used. Making sure that you have enough space in the hash table ensures that these searches remain efficient. Increase this parameter from its default of 128 buckets, based on the number of clients being supported and the type of activity the clients typically perform. Clients that open multiple files (5 or more) simultaneously (such as database or spreadsheet users) would be considered medium or heavy. All other clients fall into the light category.

---------------------------------------------------------
Number of   Light Client    Medium Client   Heavy Client
Clients     (Number of      (Number of      (Number of
            Hash Buckets)   Hash Buckets)   Hash Buckets)
---------------------------------------------------------
 100             128             128             256
 500             256             256             256
 750             256             256             256
1000             256             384             384

"coreok" specifies whether the server can create a core dump file on disastrous failures. By default, the value is set to "no".

The "maxfilesize" is the maximum file size, in KBytes, that a client
can create on the server.  The default is 20000 (200Mb), the minimum
is 100 and the maximum is unlimited.

The dirbufsize parameter (in the [lmxserver] section) specifies the amount of buffer space (in KB) allocated to hold the contents of a directory that the server is scanning on behalf of a client. The default value of 2048 is sufficient for most installations. However, if your server has very large directory structures, increasing the size of this buffer may reduce the time it takes to display a directory listing back to a client. This parameter has no effect on any other aspect of server operation. The size of a directory listing is dependent on the number of files in the directory and the length of the filenames.

The "vcdistribution" parameter (in the [lmxserver] section) specifies the lower and upper limits of the numbers of clients assigned to each lmx.srv process. The lower limit indicates the minimum number of clients that must be assigned to an lmx.srv process.

Advanced Server is designed to distribute the client load evenly over all available lmx.srv processes. Once the server has assigned a number of clients equal to the minimum threshold, it moves on to the next lmx.srv process and assigns clients until the minimum for that lmx.srv process is reached. This continues until every lmx.srv process has the minimum number of assigned clients.

Advanced Server then assigns any additional clients in a round-robin fashion, until the upper limit threshold is reached. Once the upper limit is reached for a given lmx.srv process, no additional clients can be assigned to that process unless one of the existing clients disconnects. All of this is handled automatically by Advanced Server.

The default settings for the vcdistribution algorithm are:

--------------------------------------------------------------------
Client Range   Minimum Clients   Maximum Clients   Maximum No. of
               Per Process       Per Process       lmx.srv Processes
--------------------------------------------------------------------
1-16                  2                 4                  4
17-25                 2                 5                  5
26-36                 2                 6                  6
37-50                 2                10                  5
51-100                6                20                 10
101-200               6                20                 10
201-999               8                30                 33
1000                 10                50                 20

WARNING: You can change this distribution by specifying new thresholds for the vcdistribution parameter. However, the default settings for this parameter are optimized for typical configurations; changing them is not recommended unless you are willing to carefully monitor and characterize the resultant behavior.

The default values for this parameter are:

vcdistribution=1,2,12 20,2,20 35,2,24 50,3,28 85,4,28 100,5,32 130,6,36 180,8,42 250,9,44 350,10,50 500,10,60 750,10,80 1000,10,101

[ server ]
autodisconnect=90
maxclients=1000

"autodisconnect" is the interval, in minutes, that the server will wait before dropping the virtual circuit to an inactive client. The default is 0 (no automatic disconnection), the minimum is 0 and the maximum is 3600 (60 hours).

"maxclients" is the number of clients the server can handle simultaneously, that is, the maximum number of sessions. The default is 100, the minimum is 1 and the maximum is unlimited.

The maxclients parameter (in the [server] section) identifies the maximum number of simultaneous client sessions that the server must support. This number is set by default to a number that is equal to the Advanced Server user license installed on the server computer. However, the default number often does not reflect the actual client load for a given server. An example would be a computer that has a 1000-user license, but is supporting only 200 simultaneous client sessions. In such cases, you should change the setting of the maxclients parameter to a value closer to (but slightly greater than) 200.

A good rule of thumb to follow when setting the maxclients parameter is to add 10 percent to the actual number. In this example, you would set maxclients to 220.

Setting maxclients to a value that more accurately represents the actual client load results in improved server performance. To understand why server performance improves, you need to know how the maxclients parameter affects the configuration of the server.

The Advanced Server is multi-threaded in these two dimensions:

1 - The server has multiple lmx.srv processes that actually service client requests (for example, copy a file, list the contents of a directory, or lock a file).

2 - Each lmx.srv process services requests from multiple clients concurrently (the service requests are queued and handled in a first-in, first-out order).

For example, at any given time, an Advanced Server can have four or five lmx.srv processes running, and each of those lmx.srv processes could have 8 to 12 clients connected to them. The performance of the server will depend in large part on making sure the client load is adequately distributed among a suitable number of lmx.srv processes so that a balanced load results. The maxclients value determines how this load is distributed by specifying the following items:

- maximum number of lmx.srv processes that are needed

- maximum number of clients that will be assigned to each lmx.srv process

- minimum number of clients that must be assigned to an lmx.srv process before a new process is started.

Since the value of the maxclients parameter controls the distribution algorithm, it is easy to see how setting maxclients to a value that does not represent the actual load can result in wasted resources.

To continue with our earlier example, a server with maxclients set to 1000, but with a client session population of 200, will create more lmx.srv processes than necessary for the client population. These client sessions will be distributed more heavily on certain lmx.srv processes to satisfy the higher minimum client threshold.

The following table highlights the differences between the two configurations:

-----------------------------------------------------------
Server   Maxclients   Clients per   Clients per   Number of
                      Process       Process       lmx.srv
                       Minimum       Maximum     processes
-----------------------------------------------------------
  A         200            6            20           10
  B         1000          10            50           20

A population of 200 clients on 'server A' would result in 10 lmx.srv processes. A population of 1000 clients on 'server B' would result in 20 lmx.srv processes. Depending on the workload of a typical client and the resources available on the server computer, it may make more sense to have fewer lmx.srv processes. Setting maxclients to 200 would give you this result.

For example, the server allocates resources such as shared memory based on the maximum number of lmx.srv processes expected. If you specify a large number for maxclients, the server will pre-allocate the resources necessary to support the maximum number of lmx.srv processes that number of clients will require. If the client population never reaches that number, those pre-allocated resources are wasted.

On the other hand, if the typical client workload is very heavy (for example, a diskless PC), it would be wiser to distribute the load across as many lmx.srv processes as possible. Setting maxclients to 1000 would give you this result. Different levels of performance can be achieved depending on how the maxclients parameter is configured.

Understanding the distribution algorithm helps you understand the roles that certain server tunables play, and the implications of changing them.

AFPS will need to be restarted after making these changes using the commands:

net stop server
net start server
(3) NetBIOS Support

The server comes configured to support 64 clients over the TCP/IP NetBIOS transport. The number of supported clients can be increased up to 256 by manually editing NetBIOS parameters in:

/etc/conf/pack.d/nb/space.c

Increase the values of each line to 256:

#define NB_NSESSION   64 --> 256
#define NB_NREQ       64 --> 256
#define NB_NNSREQ     64 --> 256
#define NB_NTPE       80 --> 256
The values associated with each of these parameters must not
exceed 256.  This restriction has been overcome in UnixWare 7.

You may need to modify the KP_ALIVE timeout for earlier versions of SCO OpenServer in /etc/default/nbconf:

NB_KPALIVE=0 export NB_KPALIVE

In addition, the number of TCP connections on SCO OpenServer 5.0.2 and 5.0.0 defaults to 256 in "netconfig". Increase the TCP/IP connections from 256 to 1024.

For more information, see the "Tuning TCP/IP performance" in the SCO OpenServer Performance Guide.

(4) Configure the server's Buffer Cache

See the SCO OpenServer Performance Guide on tuning the NBUF and NHBUF kernel tuning parameters available from:

http://<your_server>:457/ASUGetStart/asustartT.tune_buffers.html
(5) Check the FileSystem Usage

If your server has become 100% busy, as shown in "sar -u", and a number of "lmx.srv" processes are consuming kernel %sys resources and %user and %wio resources are fine, then it is possible that your server is getting low on disk space in the partition where a lot of AFPS activity is taking place.

By increasing the amount of disk space available, by either installing a larger disk or performing some housekeeping, AFPS performance can increase.

(6) Check the network
(6a) Check the integrity of the network LAN to ensure that problem
is not with a faulty cable or piece of network equipment.  One
way to do this is to isolate the server and a client on a separate
LAN and see if the problem still occurs.
(6b) The NIC may be faulty.  Check with the manufacturer for their
latest diagnostic and setup software to configure the NIC to
optimal values.  Some NIC's set to "auto-sensing" the network
speed can be the cause.  This depends on the manufacturer and
the revision of the card being used.
(6c) The NIC driver may require upgrading.  Check SCO's web site:
https://ftp.scoexpert.com/openserver5/drivers/

The manufacturer may also provide a later, SCO unsupported, version of the driver.

(6d) Ensure the server has the latest patches available for download from:

https://ftp.scoexpert.com/openserver5

(6e) Check to see if the network is particularly busy by using the "netstat -w <interval>" command to see how many packets are passed through the NIC in each time interval.

(6f) Use another method to transfer file(s), such as "ftp", to
see if the speed is still slow.  If the speed is also slow,
then this identifies that the problem does not relate entirely
with AFPS, but is more network related.

(6g) Remove any unnecessary protocols such as NETBEUI or NFS from the TCP/IP stack within "netconfig".

See also

srvstat(AS), lmstat(AS)
The AFPS Administration Guide available from:
http://<your_server>:457/asuhome.html

The SCO OpenServer Performance Guide for TCP/IP available from:

http://<your_server>:457/PERFORM/TCP_tuning.html

From the Xinuos technical article database, record 112781. Reproduced with permission. The original is at www.sco.com/ta/112781, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.