You can estimate VTAM® buffer pool storage when you use the distributed
data facility of Db2. Every path
information unit (PIU) that enters or leaves VTAM resides in one or more IOBUF buffers.

## About this task

A PIU is composed of a 26-byte transmission header,
a 3-byte request/response header, and the request/response unit (RU)
that contains VTAM application
data. You define the length of the RU in a mode entry, using the RUSIZES
option.

## Procedure

To calculate the maximum number of buffers that are required
for the local Db2 subsystem:

- Calculate the number of buffers that each PIU occupies,
and call it PIUBUF.
`PIUBUF = CEILING(( 29 + RUSIZE ) / BUFSIZE)`

RUSIZE
is the length of the RU in bytes. It is assumed to be the same for
both session directions. BUFSIZE is the value you specified in the
IOBUF pool definition.

Assume you have a buffer size of 441
bytes, and an RUSIZE of 4096. With these values, PIUBUF would be 10
((29+4096) / 441, rounded up).

For channel-to-channel (CTC)
and NCP connections, you need to be concerned with the VTAM MAXBFRU value. For CTC connections, MAXBFRU
is the number of 4KB buffers allocated to hold the PIUs sent over
the channel. If your RU size is 4096 and you allow 29 bytes for the
header, then you need to allocate at least 2 4KB buffers. Thus, you
need a MAXBFRU value of at least 2.

When you route data through
NCP, MAXBFRU is the number of VTAM IOBUF
buffers allocated to hold the PIUs sent to the NCP, which means MAXBFRU
must be at least as large as PIUBUF.

- Calculate the maximum number of IOBUF buffers used by a
session, and call it SESSBUF.
`SESSBUF = PACECNT × PIUBUF`

PACECNT
stands for pacing count. For this example, assume that pacing is the
same in both directions, and it is the same for all modes.

If
pacing is set to 2, then SESSBUF is 20.

- Calculate the maximum number of sessions that can be active
for all modes to all systems and call it SESCNT. Calculate the maximum
for each mode, then add those results to get SESCNT.
- Calculate the maximum number of VTAM buffers used by Db2, and call this DB2BUF.
The formula
for DB2BUF is based on a worst case scenario, because it assumes that
all sessions are used by concurrent conversations.

`DB2BUF = SESCNT × SESSBUF`

If
you assume that the maximum number of sessions that can be active
is 50 (SESCNT), then 1000 is the number of IOBUF entries required
by Db2 in a worst case scenario.

- Calculate actual VTAM buffer
storage consumption used by Db2,
and call it STORAGE.
`STORAGE = DB2BUF × (BUFSIZE + 71)`

Each
buffer includes 71 bytes for VTAM internal
headers.

So, to continue the above example, an upper value of
real storage is estimated as follows:

`1000 × (441 + 71) = 500KB`