Configuring $PSTAT

The KCML partition, terminal, global library, and KPrint Licence tables are stored in shared memory known as $PSTAT. These tables are created when the first KCML product is executed after system start-up. Once these tables have been created their size cannot be changed.

Table 1: Configurable $PSTAT limits
TableDefault Sizebkstat command-line flagkcml.conf key
Partition1024 Unix, 512 Windows-x max_partsMaxPartitions
Terminal1024 Unix, 512 Windows-y max_termsMaxPartitions
Global library20-n max_globalsMaxGlobals
KPrint Licences256-R max_licMaxKplic

There a three methods of choosing alternative dimensions of some of the tables in $PSTAT.


kcml.conf

Starting KCML 6.20.83 and 7.05, the maximum number of partitions can be configured using a configuration file called /etc/kcml/kcml.conf.
For example, to create a $PSTAT area that can store 4096 partitions/terminals, 32 global library processes and 512 KPrint licences

[PSTAT]
MaxPartitions=4096
MaxGlobals=32
MaxKplic=512

This will affect the creation of $PSTAT for all values of $SYSTEMID.


Extended partitions

Recent changes and new functionality have required that the size of a partition in $PSTAT to be increased. This is accomplished by the kcmlinst script creating a /etc/kcml/pstat_X file. The size of the partition is 2X, so if /etc/kcml/pstat_8 exists, then a partition will be 256-bytes. When there are multiple pstat_X files, the largest value of X is used.


$KCML_PSTAT_SIZE

The $KCML_STAT_SIZE environment variable was introduce to provide a platform independant method of increasing the maximum number of partitions and terminals.

Configuring $PSTAT using bkstat

The original method of configuring alternative $PSTAT sizes was to use bkstat's -x & -y command line switches. This can be done in a boot script which are command shell scripts which are executed when the server boots up. A typical example of this is the boot script for the Remote Licence Daemon. The boot script for the Remote Licence Daemon is executed just before inetd is started ensuring that no-one can log-in, and start a KCML process, before bkstat has created the correctly sized $PSTAT tables.

or example:

# Add /usr/local/kcml to PATH
PATH=/sbin:/usr/sbin:/usr/bin:/etc:/usr/ccs/bin:/usr/local/kcml
export PATH
# Use this script to set up PSTAT and to start KCML deamons
# Change size of partition, terminal and KPrint licence tables
/usr/local/kcml/bkstat -x 4096 -y 4096 -R 1024
# Start the KPrint licence server
/usr/local/kcml/kplicserver &

would allow a maximum of 4096 KCML partitions to run from a maximum of 4096 terminals. The Remote Licence Daemon would also be able to manage licences for 1024 KPrint servers, provided the licence file has enough queues. The max_parts & max_terms values for the -x & -y flags must have the same value.