Consultor Eletrônico



Kbase 11937: How to tune the UNIX Kernel parameters for Progress.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
Solution ID: 11937

GOAL:

How to tune the UNIX Kernel parameters for Progress.

FACT(s) (Environment):

Unix

FIX:

Overview:

In many cases the default values for most of the UNIX kernel are sufficient. In other cases, the Progress application runs for some time without requiring any kernel tuning but as more users are added to the UNIX system and/or the number of processes executed increases,
Progress might return system errors that indicate a shortage of some resource (memory, number of files that can be opened by a user ..).

When this happens it might be necessary to re-tune the kernel parameters and generate a new kernel.

Where applicable, this solution indicates whether a particular parameter is no longer required by System V Release 4 UNIX, where the value for the parameter is now dynamically allocated in SV4, or where a SV3 parameter is superseded by SV4 kernel parameter.

NOTE: Kernel parameter names vary from system to system. This solution provides an overview so that you can direct the user/customer to the correct kernel parameter on the particular system. If you are in doubt, consult your system documentation.


What is the kernel?

The kernel is the heart of the UNIX operating system. It manages memory, schedules processes, manages I/O, and does all other lower-level tasks that make the system work. The kernel is not a process (like the programs that you run from a terminal). It pre-exists all processes and is responsible for starting the first process.

Because it is so important, the kernel has some key privileges. It is always resident in the processor's physical memory. Other programs can be swapped or paged to disk, but not the kernel.

Current kernel parameter values can be seen as follows:

The name of the kernel configuration file and its location varies from system to system.

On BSD (Berkley UNIX), the configuration files are usually kept in the directory /sys/conf or /usr/sys/conf. Within the directory is a file named GENERIC that contains the default kernel parameters. A copy of this file is used for making a new kernel.

On System V machines, look for the configuration files in /etc/conf/cf.d. The tunable parameters are usually located in the mtune file. Normally there is a second file in the kernel configuration directory that is used to modify the parameters (Never modify the master file mtune). This second file (sometimes called stune) is used to modify a parameter to any value between the minimum and maximum values defined in the master file (mtune).

NOTE: If you are in doubt, consult your system documentation.

On some System V systems, you can log in as root and type "sysdef" at the command line to see the current values. If this is not possible, you could enter the system administration shell (a menu-driven interface SMIT on AIX, sysadmsh on SCO) and view the kernel settings.

Some example directory locations for the files are:

/etc/conf/cf.d
/usr/kvm/sys/sun4/conf

The most common important kernel parameters are as follows.


General Kernel Parameters:

   NPROC
       The maximum number of simultaneous processes that the system can run.

   MAXPROC, MAXUP
       The maximum number of processes that any user (any user ID number) can have at one time.

   NFILE
       The maximum number of files (system-wide) that can be open at any time.

   NOFILES (superseded by SFNOLIM, HFNOLIM in SV4)
       The maximum number of open files the process might have. When this limit is exceeded, attempts to open files fails and errno is set to EMFILE. SFNOLIM and HFNOLIM are SV4 soft and hard limits.

   ULIMIT (superseded by SFSZLIM, HFSZLIM in SV4)
       The size of the largest file that a process can cr.eate. SFSZLIM and HFSZLIM are SV4 soft and hard limits. There are user-level ways of overriding this kernel limit, such as the ulimit command and the ULIMIT line in /etc/default/login.


Memory Management Parameters:

   MAXUMEM (superseded by SVMMLIM, HVMMLIM in SV4)
       The maximum amount of memory that is used to run a process. For System V 3, the parameter limits a process's virtual address space.

   SVMMLIM (SV4 only)
       The soft limit that specifies the maximum address space that can be mapped to a process. Attempts to increase a process's address space beyond this value fails with an ENOMEM error.

   HVMMLIM (SV4 only)
       The maximum value of SVMMLIM.

   MAXPMEM (SV4 only)
       Specifies the amount of physical memory in use ages. The value 0 means "use all of physical memory".


Inter-Process Communication (IPC) Parameters:

   SHMMNI
       The maximum number of shared memory identifiers allowed for the system.

   SHMALL
       The maximum number of in-use shared memory segments allowed for the system. Some systems do not have this parameter (Sun OS, DG 5.4, SCO Unix 5.0.5 increases this value dynamically).

   SHMMAX
       The maximum size of a single shared memory segment. Some systems (Sun OS) call this parameter SHMSIZE.

   SHMSEG
       The maximum number of shared memory segments a single process can attach to. Some systems do not have this parameter (Sun OS, SCO Unix 5.0.5 increases this value dynamically).

   SEMMNI
       The maximum number of semaphore identifiers that are allowed for the system.

   SEMMSL
       The maximum number of semaphores allowed per semaphore identifier (semaphore set).

   SEMMNS (some SV4 systems may dynamically allocate this parameter)
       The total number of semaphores allowed for the system.

   SEMMNU (some SV4 systems name this paramter SEMUME [DG])
       The maximum number of semaphore undo structures allowed for the system.


STREAMS Parameters:

Progress only requires STREAMS to be installed. It does not require specific values for the streams parameters. When you see the error:

Select Returned -1, errno=11 (793)

you must install STREAMS.


Progress and General Kernel Parameters:

As more processes are executed simultaneously on a machine, it might be necessary to increase the NPROC parameter. If you exceed the NPROC or NSWAP parameter, Progress returns the error message:

Too many subprocesses, cannot fork. Errno=<number>. (358)
Unable to fork process.

Progress statements OUTPUT THROUGH and INPUT THROUGH open pipes to UNIX that create additional processes on the system. If the problem is related to NSWAP, you could try reducing the local buffer (-l) or edit buffer (-e) start up parameters.

In some cases, one particular user could require additional processes to be executed and might require the MAXPROC, MAXUP parameter to be increased. If additional files are opened as a result of increasing the number of processes that are executed or as a result of converting a database from single volume to multi volume, you might need to increase the NFILE, NFILES (SV4: SFNOLIM, HFNOLIM) parameters.


Progress and UNIX shared memory:

The following suggested settings are for Progress applications. The values required by Progress must be added to the current kernel pa.rameter values. In other words, the following recommendations do not take into account the requirements of the UNIX operating system and/or any other application that uses shared memory and semaphores. Consult your system documentation to determine UNIX's requirement.

Progress uses shared memory to allow multiple server processes and self-service client processes concurrent access to a database, and to coordinate their activities.

The shared memory area contains the buffer pool, lock table, log buffers, and other shared data structures. When the database is started (via the PROSERVE command), the broker creates and initializes the shared memory area of the required size. The size is based on the values of various startup parameters that determine the sizes of the data structures.

In UNIX systems, shared memory consists of one or more segments. Each segment is identified by a system-wide unique number that is assigned by the process that creates the segment. Progress derives the identifier from the inode of the .db file.

There are several UNIX kernel parameters that limit the number and size of shared memory segments. In addition, Progress has an internal limit on the size of a single shared memory segment. If the shared memory size computed by the broker is larger than the maximum segment size allowed, the broker creates multiple segments to reach the required total.

The total amount of shared memory that can be allocated is:

SHMMAX * SHMALL (or SHMMAX * SHMMNI)

When you install Progress, you might have to increase the values of these parameters. Note that if you are running other software that also uses shared memory, you must take into account the combined requirements.


Recommended Settings:

   SHMMNI
       Depends on the number of active databases, the values of startup parameters, and the value of SHMMAX. The larger SHMMAX is, the fewer segments Progress creates. 64 is probably a good value to start with. If the parameter is set too low you might get System error 1137 or System error 1138.

   SHMALL
       The same as SHMMNI. If the parameter is set too low you might get System error 1137 or System error 1138.

   SHMSEG
       The setting depends on the number of active databases, the values of startup parameters, and the value of SHMMAX. The larger SHMMAX is, the fewer segments Progress creates. When self-service clients connect to multiple databases, the shared memory segments for the database are attached. 16 is probably a good value to start with. If the parameter is set too low you might get System error 1175, System error 1719 or System error 1720.

   SHMMAX
       Sequent: 134,217,728 bytes (Version 6.3 and above).
       Others: 16,777,216 bytes (Version 6.3 and above).
       This parameter limits the size of a single segment. Progress creates one smaller segment if less shared memory is needed. Smaller values do work, as long as they are higher than 8,192, but they are not recommended.
       The units that you use to specify a value for SHMMAX vary from system to system. Some units use bytes, others use "clicks" (page size). Consult your system manuals for the proper units.
       If the parameter is set too low you might get System error 1135. Progress might create many small segments, possibly overflowing the limits SHMMNI, SHMSEG, or SHMALL.


NOTE: The amount of kernel memory required for shared memory descriptions (not the shared memory itself) is relatively small, so setting SHMSEG, SHMMNI, SHMALL higher than your current needs probably won't affect performance.

Shared memory is not .used for single-user sessions. Clients that connect to a remote database on a server machine do not use shared memory on the client machine.


Progress and UNIX Semaphores:

The following suggested settings are for Progress applications. The values required by Progress must be added to the current kernel parameter values. In other words, the following recommendations do not take into account the requirements of the UNIX operating system and/or any other application that uses shared memory and semaphores. Consult your system documentation to determine UNIX's requirement.

Progress uses UNIX Semaphores to synchronize the activities of server processes and self-service client processes that are connected to a database. The semaphores are created and initialized by the broker when the database is started.

UNIX semaphores are grouped into semaphore sets. Each semaphore set has a unique identifying number called a semid. Within a semaphore set, individual semaphores are identified by an integer that ranges from 0 to one less than the size of the semaphore set.

The Progress broker creates a semaphore set when the database is started. The size of the set is the number of users (-n parameter) plus the number of servers (-Mn parameter) plus 4.


Recommended Settings:

   SEMMNI
       One per active database. If the parameter is set too low you might get System error 1131.

   SEMMSL
       Maximum number of users on any database + The maximum number of servers for any database + 4 + The number of Asynchronous Page Writers (APW) + Before Image Writer (BIW) + After Image Writer (AIW) + Watchdog Process. If the parameter is set too low you might get Warning 1093 or System error 1130.

   SEMMNS
       SEMMSL * the number of active databases. If the parameter is set too low you might get Warning 1093, System error 1131 or System error 1195.

   SEMMNU
       Set equal to one per Progress process connecting to a database. (each server process, self-service client, page writer, BI writer, AI writer, watchdog, PROSHUT, PROMON. To avoid system errors set SEMMNU = SEMMNS. If the parameter is set too low you might get System error 1081.


NOTE: The amount of kernel memory required for semaphores is relatively small, so setting the limits higher than your current needs probably won't affect performance.

Semaphores are not used for single user sessions. Clients that connect to a remote database on a server machine do not use semaphores on the client machine..