z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Maximum number of sockets

z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
SC27-3660-00

For most socket interfaces, the maximum number of sockets allowed per each connection between an application and the TCP/IP sockets interface is 65535. The exceptions to this rule are the C sockets interface and the C sockets interface for CICS®, where the maximum allowed for both of these interfaces is 2000.

Programmers need to be aware that for an application using a sockets interface that uses Sockets Transform (for example, the EZASMI macro API, the callable EZASOKET API, CICS Sockets, or IMS™ Sockets) approximately 68 bytes of storage per socket in the application's address space is allocated when the application connects to the TCP/IP sockets interface. Each time a REXX client opens a socket, approximately 208 bytes of storage is allocated. If an application using a sockets interface that uses sockets transform requests 65 535 sockets, then approximately 4.25 MB (65535*68 bytes) of storage in the application's address space is allocated just for the socket array. If a REXX client opens 65535 sockets, then approximately 13 MB (65535*208 bytes) of storage is allocated for the socket chain. The monitoring and processing of this many sockets is also costly in terms of performance and CPU utilization.

The number of sockets that an application can open is also limited by the MAXFILEPROC UNIX System Services parameter in the BPXPRMxx parmlib member. This parameter determines the number of sockets each z/OS® UNIX System Services process can have open. Each address space is usually a z/OS UNIX System Services process. Thus, in most cases the combined number of sockets opened by all the applications within an address space is limited to the MAXFILEPROC parameter. If MAXFILEPROC is 65535 and two different applications within the same address space both request 65535 sockets, then the two applications will not be able to concurrently have 65535 sockets open. If one of the applications has 65000 sockets open, then the other application will not be able to have more than 535 sockets open even though it has allocated 65535 sockets.

The number of sockets that an application can open in a particular addressing family is also limited by the MAXSOCKETS parameter in BPXPRMxx parmlib member's NETWORK statement that corresponds to the addressing family. This value determines how many sockets for a particular addressing family can be opened in the entire system. If MAXSOCKETS for the AF_INET addressing family is set to 60000 and there are already 50000 AF_INET sockets open in the system, then a new application will not be able to open more than 10000 AF_INET sockets even if it requests a higher number when it connects to the TCP/IP sockets interface.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014