Dynamic Swap-Pool Reorganization

This document describes the prerequisites, process, control and start of a dynamic swap pool reorganization.

The section covers the following topics:


Requirements for Dynamic Swap-Pool Reorganization

Dynamic swap pool reorganization is only possible when the physical swap pool contains only one logical swap pool. In this case, the swap pool slots are all of the same size. If necessary, the number of logical swap pools and the slot sizes can be adjusted to meet the requirements. Slot sizes are adjusted by reorganizing the swap pool dynamically.

Statistics Tables

The statistical area of the swap pool directory contains two statistics tables which are used for swap pool reorganization:

  • swap-pool-reorganization plus table

  • swap-pool-reorganization minus table

Swap-Pool-Reorganization Plus Table

The swap-pool-reorganization plus table contains information on the Natural user areas which could not be placed into the swap pool because their compressed length exceeded the swap-pool slot size.

The table contains 11 entries:

  • The first 9 entries count the number of user areas whose length exceeded the slot size by 1 to 9 units.

  • The 10th entry counts the number of user areas whose length exceeded the slot size by more than 9 units.

  • The 11th entry contains the average length of those user areas counted by the 10th entry.

Swap-Pool-Reorganization Minus Table

The swap-pool-reorganization minus table contains information on the Natural user areas whose compressed length was smaller than the swap-pool slot size.

The table contains 11 entries:

  • The first 9 entries count the number of user areas whose length was smaller than the slot size by 1 to 9 "units".

  • The 10th entry counts the number of user areas whose length was smaller than the slot size by more than 9 units.

  • The 11th entry contains the average length of those user areas counted by the 10th entry.

The size of a "unit" is defined with the keyword parameter SWPFACT.

Parameters for Swap-Pool Reorganization

Dynamic swap-pool reorganization is controlled via the following keyword parameters in the macro NTSWPRM.

Parameter Specifies
SWPSLSZ the slot size for the first initialization of the swap pool. The default size is 62 KB.
SWPTFIX if the slot size is to be fixed or dynamic. With fixed slot size, there is no dynamic swap pool reorganization. If the slot size is defined as not fixed, the swap pool is dynamically reorganized when necessary (this is the default).
SWPTIM1 the time interval at which a check is to be performed to ascertain whether a swap pool reorganization is necessary. By default, the check is performed every 30 minutes.
SWPTIM2 the time to elapse after the check for the necessity of a swap pool reorganization is performed and before the reorganization is to be started. By default, a reorganization is started 2 minutes after a check has proved a reorganization to be necessary.
SWPUSER the rate of compressed user threads (in percent) which are too long for the actual SWP slot length. If this value is reached and the physical SWP contains only one logical swap pool, an SWP reorganization will be announced.
SWPFACT the factor for a "unit" in the swap pool reorganization plus table and minus table.

There is no need to change the default values for any of these parameters (unless you feel that slot size optimization is not performed efficiently enough).

For testing and optimizing, you can dynamically change the values for these parameters online using the Natural Swap Pool Manager, which is part of the Natural utility SYSTP.

Checking for the Necessity of Swap-Pool Reorganization

The check is based on:

  • the overall number of dialog steps during the time between two checks;

  • the percentage defined with the SWPUSER parameter;

  • the maximum number of logical swap pools defined with the SWPLSWP parameter;

  • the minimum difference of slot sizes for different logical swap pools;

  • the values of the swap-pool reorganization plus and minus tables (these tables are influenced by the setting of the SWPFACT parameter);

  • the total size of the physical swap pool.

The number of necessary logical swap pools with the corresponding slot sizes will be computed if the number of user areas whose compressed length was greater or smaller (by at least one unit) than the current slot size is more than n percent of the number of dialog steps (n being the value of the SWPUSER parameter).

When the swap pool is reorganized, the new logical swap pools are used. If the physical swap pool contains more than one logical swap pool after the reorganization, there will be no further dynamic swap-pool reorganization.

Flow of Dynamic Swap-Pool Reorganization

Natural will only check whether the swap pool needs to be reorganized if the physical swap pool contains no more than one logical swap pool.

Once the time specified with the SWPTIM1 parameter has elapsed, a check is performed to determine whether a swap-pool reorganization is necessary.

  • If swap-pool reorganization is not necessary, the timer set with the SWPTIM1 parameter (time interval between checks) is activated again.

  • If swap-pool reorganization is found necessary, the timer set with the SWPTIM2 parameter (time interval between end of check and start of reorganization) is activated: no further user areas can be placed in the swap pool; user areas held in the swap pool can still be used and read into the user thread. Once this second time interval has elapsed, swap-pool reorganization is started.

Start of Dynamic Swap-Pool Reorganization

After the time specified with the SWPTIM2 parameter has elapsed, the swap pool is reorganized while the current online session continues:

  1. The compressed user areas which are still held in the swap pool are written to the swap file (or roll facility under CICS).

  2. The contents of the swap-pool-reorganization statistics tables are written to SYSLST and then deleted from the tables.

  3. The swap-pool is re-initialized with the newly computed values.

  4. The timer set with the SWPTIM1 parameter (time interval between checks) is activated again.

The Natural swap-pool manager, which is part of the Natural utility SYSTP (see the Natural Utilities documentation), can be used to obtain information on swap pool statistical data, sizes of Natural buffers and user threads.