Communicator e3000 MPE/iX Release 7.5 (Software Release C.75.00) (30216-90336)

Chapter 5
Technical Articles
More Opened Files in MPE/iX Programs
124
More Opened Files in MPE/iX Programs
by Janardhanan.PS, Prakash.SR Commercial Systems Division
Introduction
When a file is opened by a process, an entry is made in a table of finite size. The number of files that can be
opened concurrently in a program depends on the size of this table. It also depends on several other resources
used in the program. In a POSIX program, many resources are treated as files for ease of reference. They are
sockets, pipes, streams etc. With MPE/iX being used as a web server by more and more customers, entries in
the process local file table are being used extensively. This in turn limits the number of files that can be
opened by a process. This article describes an enhancement to MPE/iX 7.5, enabling a process to open more
files.
Current Limitation
At present, a process can keep only up to 1024 file objects in the opened state. This includes 9 system files,
sockets, pipes, streams etc. For regular MPE files, one entry is made in the Process Local File Descriptor
(PLFD) table and for pipes, two entries are made. When a device like a serial communication channel is
opened, then one entry is made in this table.
Need for Expansion
With MPE/iX being ported to high-end systems, the environment in which it is being used is also changed.
Applications running on multiple low-end systems are consolidated into single high-end systems. During
consolidation and application enhancements, several customers have run into this limit. They were
overcoming this limit by restructuring their applications. Most of them reached a state in which they cannot
manage by restructuring alone. The main factor now is the number of devices that are used in the
applications. Most of them have exhausted all available options to further reduce the number of files they
need to open. The limit on files opened per process is now preventing the number of their clients to grow. This
had a significant negative impact on many solution providers.
A process can open up to a maximum of 1024 sockets concurrently. This allows 1024 simultaneous external
connections. For any useful application, the program needs to open a large number of files also. Unless the
size of the PLFD table is increased, one program can never to make use of the maximum number of allowed
socket connections.
To enable the customers to open a large number of files in their programs and to make more external socket
connections, it was decided to increase the number of entries in the PLFD table from 1024 to 4096.
Design Changes
There are 3 tables in which the file information is stored. All of these tables are per process structures. The
first table is the Process Local File Descriptor (PLFD), this table is used to keep track of the opened files.
This table exists in the system global space. The entry number in this table is same as the file number
returned to the user, when a file is opened. The size of this table is increased to the limit based on demand, in
multiples of 64 at a time. To begin with, a process starts with a table having a size of 64. The size of this table
can be increased 63 times. This allows a maximum of 4096 opened files. Since the size of the table is increased
based on demand, the impact on the consumption of system global space is negligible for existing installations
which do not need this enhancement.