Configuring UNIX for PFXplus

Disk buffers | File locks | Other changes?

Gary Schmidt - UNIX Guru - Powerflex Corporation

In this article I address configuration of your system for optimisation of the performance of a PFXplus application running under UNIX.

A version of this article was originally published in POWERlines Volume 3, No. 8.

Disk Buffers

The first configuration item that should be modified on a UNIX system is the amount of memory allocated to, and number of, disk buffers. Some UNIX systems do not allow this value to be modified, dedicating a fixed fraction of physical memory to disk buffers, where others give you a vast array of items that may be changed.

How to change the configuration of your system, and where to change it, is set out in one or more of the System Administration manuals. What to change it to is an interesting question. The only answer is to examine the memory usage on the machine at a typical stage of a day's use, and set the value to use up a large amount of the free physical memory.

Note that some systems have a limit on the size and number of disk buffers, often for good reasons, so do not override the limit unless you are sure what will happen.

Of course if the machine has no free physical memory, you can raise the value anyway, which will force more of the idle and housekeeping tasks to be swapped out onto disk. This may lead to a degradation of performance due to increased swapping, so you have to either obtain more physical memory, or accept that you have a slightly slower computer than yesterday.

Be aware of the 16-megabyte boundary problem on ISA PCs running UNIX. You can get some very strange behaviour if the disk buffers are above this boundary on these machines. This does not apply to EISA PCs, or mini-computer architectures.

File Locks

Some systems allow you to configure the number of file locks which can be taken out. Raise this to a value 10-50% greater than the total number of database files that will be opened overall, to avoid a deadlock caused by insufficient resources.

Files (NFILE), Inodes (NINODE), Process Files (NOFILES), iMaxFiles and iMaxHandles should be set in conjunction.

NFILE is the maximum number of open files system-wide.

NINODE is the maximum number of active files and directories and mount points, and should be greater than or equal to NFILE.

NOFILES is the maximum number of open files per process.

Some systems do not allow some or all of these values to be modified. In particular, Xenix systems have a fixed value for NOFILES of 20 on older systems, or 60 on newer systems.

The iMaxFiles and iMaxHandles values are part of the configuration of PFXplus, and are set in the PFX.INI file. They interact with the system controls on the number of open files, both by a single process and system wide.

iMaxHandles is the maximum number of system file handles actually used by PFXplus.

iMaxFiles is the maximum number of files opened internally by PFXplus, which can be a lot greater than iMaxHandles.

Here is a guide to calculating these values, but be aware of limits on the values.

All processes use at least 3 file handles.

PFXplus only reuses file handles allocated to database files and index files that are not locked.

Take an application that uses 9 databases, each with 9 indexes, so if they are all opened at once, I need 100 file handles, plus 3 allocated at the start for terminal I/O, and I use 7 direct files.

I need NOFILES to be set to 110, and if I have 10 users, NFILE must be at least 1100, and NINODE greater again. Applying Finagle's Factor to the numbers, I would set NFILE to 2000, NINODE to 2500, NOFILES to 120, iMaxHandles to 115, and iMaxFiles to 150.

If my system has a limit of 100 on NFILE, I cannot set these values. In this case I would increase NFILE to 2000, and set NINODE to 2500, NOFILES to 100, iMaxHandles to 95, and iMaxFiles to 150. You will see that I keep iMaxHandles below NOFILES. This is to preclude consuming all the handles in the system.

An application using 200 database files, with an average of 5 indexes per database, would need an iMaxHandles value of at least 2010 to run, and would want as high a value for NOFILES as possible, which will in turn affect the values of NFILE, NINODE, and iMaxFiles.

Is There Anything Else?

Quite probably, but this depends on what else the system is doing: if you are running TCP/IP, or NFS, or X-Windows, or LAN Manager ... the list goes ever and on. There are many other values that will effect the overall performance of the system, and thus the performance of PFXplus.

Back to FAQ Page