Storage requirements

From m204wiki
Jump to navigation Jump to search

Each Janus connection requires several control blocks which maintain connection information and allow transfering of data between the server and client. Janus control blocks are allocated from SPCORE (above the line when possible) based on parameters set in the JANUS DEFINE command for the port.

The storage requirements for connections on a given port are calculated as:

#bytes = maxconn * (ibsize + obsize + maxrec + 1024)

The storage requirements for OPENSERV and SDS connections on a given port are calculated as:

#bytes = maxconn * (ibsize + obsize + rbsize + 2080)

The storage requirements for WEBSERV connections on a given port are calculated as:

#bytes = maxconn * (ibsize + obsize + rbsize + 1520)

The additional storage requirements for any secure (SSL) connections are:

#bytes = maxconn * sslbsize

Where:

maxconn The maximum number of connections allowed for the port.
ibsize The input buffer size (default is 4096; see IBSIZE).
obsize The output buffer size (default is 8192; see OBSIZE).
rbsize The RPC buffer size (default is 4096; see RBSIZE).
maxrec The maximum record length (256 is the default; see MAXREC).
sslbsize The SSL buffer size (default is 4096; see SSLBSIZE).

For example, if 3 Janus ports are defined, one an OPENSERV port with 50 maximum connections, another a WEBSERV port with 20 maximum connections, the third a secure WEBSERV port with 10 connections and all default values are used, you would get:

923,200 = 50 * (4096 + 8192 + 4096 + 2080) (OPENSERV 1) + 358,080 = 20 * (4096 + 8192 + 4096 + 1520) (WEBSERV 1) + 179,040 = 20 * (1024 + 1024 + 1024 + 2260) (WEBSERV 2) + 40,960 = 10 * 4096 (SSL buffs) ----------- 1,501,280 = total SPCORE bytes required

If ALLOCC is not specified on the JANUS DEFINE commands, this space is allocated when the ports are started. If ALLOCC is specified, the space required for each connection is allocated when the connection is established. Specifying ALLOCC leaves SPCORE space free until it is needed, but may result in storage fragmentation. Even with ALLOCC specified, 1024 * maxconn bytes of space are reserved in SPCORE for each possible Janus connection at the time of the START command. This space is not freed until the port is completely drained of all connections either via the DRAIN or FORCE command.

Except for SSLBSIZE, the only reason for using buffer sizes other than the defaults is TCP/IP efficiency. No values other than SSLBSIZE place limits on lengths of passed data. If a client attempts to pass an SSL block larger than SSLBSIZE, the secure connection is immediately terminated.

See also