Performance Tuning Parameters

Adjusting Disk Cache Parameters

HPFS-partitions

The basic parameters are controlled via the CONFIG.SYS statement

IFS=X:\OS2\HPFS.IFS /CACHE:x [/force] [/quiet] /CRECL:y /AUTOCHECK:zzz

where X is the boot drive letter and,
x : The amount of RAM in kilobytes used for the HPFS cache.

y : The maximum cached block size in kilobytes. The possible values are from 2K to 64K.

zzz: The list of HPFS drive letters on which the CHKDSK (with the option /F) will be performed automatically, in the case the system was not shut down properly. Placing the plus sign in front of a drive letter causes that this drive is checked during every boot-up.

The optional (and undocumented) switch /force is intended to allow the immediate access to an improperly stopped HPFS drive without necessity to run CHKDSK /F on it (such a drive does not appear in the /AUTOCHECK list). The switch /quiet disables the error messages. It should not be put as the last parameter of the IFS statement.

The fine-tuning of the HPFS cache is achieved via the CACHE command. The following are the switches for this command:

/diskidle:x
Sets the amount of time in milliseconds that the disk must be idle, before the data in the cache memory can be written to it. The default is 1000.
/maxage:y
Sets the maximum amount of time in milliseconds before a block in the cache memory will be written to the disk. The default is 5000.
/bufferidle:z
Sets the minimum amount of time in milliseconds that should pass before a cache buffer can be written to the disk. The default is 500.
/dirtymax:u
Defines the maximum allowed number of unwritten buffers in the cache. After this number is reached, all unwritten buffers are cleaned up.
/writecache:v
Defines the maximum size of the data block (in bytes) that can be put in the cache memory. By default it is set to 64x1024.
/readahead:0/1
Enables or disables read-ahead operations.
/dstg:on
Enables the long display of the cache status (including /writecache and /dirtymax).
/lazy:ON/OFF
By its nature this switch must be applied within a separate CACHE command. It enables/dispables the HPFS cache. If set to n, it enables exactly n lazy writers.
The CACHE command can be executed from the command window, or from the CONFIG.SYS file via one or several RUN statements.

FAT-partitions

The syntax of the cache statement for FAT partitions is
DISKCACHE=x, LW, T, AC:zzz
where LW indicates the lazy-write cache operations. Omitting this is equivalent to immediate write of the cache to the disk, and T is the threshold size of the number of FAT sectors that may be placed into the cache. The range is from 4 to 128 and the default is 4. Finally,

x : The size of the FAT cache in kilobytes.
zzz : The list of drive letters of FAT-formatted partitions to be checked automatically during the boot sequence, in the case of an improper shutdown.

Swap File Considerations

The swap file location and size are controlled by the statement
SWAPPATH=TheLocation x y
where

TheLocation: This is the swap file (=SWAPPER.DAT) location. The default is X:\OS2\SYSTEM.
x : The minimal amount of free partition space in kilobytes. When the swap file increases, living less then this amount of free space, a warning message appears.
y : The initial size of the swap file, in kilobytes.

The swap file dynamically changes its size. It is recommendable to fix the initial size so that the system would normally work without frequent changes in the swap file size--such swap file adjustments hurt the system performance.

It is recommendable to place the swap file in the root directory of the most frequently used partition of the least frequently used hard drive.

Multitasking-Related Parameters

Controlling the Application Priority

The statement
PRIORITY_DISK_IO=YES/NO
determines how the system will treat the foreground applications. When set to YES, disk I/O operations associated with foreground aplications will get a nontrivial priority boost over the background processes. This is the default behavior.

Similarly, the statement

PRIORITY=DYNAMIC/ABSOLUTE
controls how the system treats the foreground applications, from the point of view of the allocated CPU time. The default is DYNAMIC, which means a foreground application gets a performance boost. Also, in this case moving a pointer over the application window will increase the priority. Setting PRIORITY to ABSOLUTE means background and foreground applications will be treated on the equal footing.

In a server-like situation, it is reasonable to consider setting the above variables to NO/ABSOLUTE, so that background processes would not be affected by the foreground ones.

Controlling the Threads

The statement
THREADS=n
defines the maximum number of threads that can be simultaneously running in the system. The range is from 64 to 4096.

The statement

TIMESLICE=x,y
defines the minimum=x and the maximum= time (in milliseconds) that the system spends executing a thread, before passing to another thread of equal priority.

By default, the TIMESLICE statement is not present in the CONFIG.SYS file, and the operating system uses the dynamical timeslicing algorithm. This means that the minimum/maximum timeslice values depend on the actual system conditions.

The statement

MAXWAIT=z
defines the amount of thread waiting time (in seconds), before the operating system will assign a higher priority to the thread. By definition, this works only if PRIORITY is set to DYNAMIC. The range for z is from 1 to 255, and the default is 3.

The operating system (together with applications, when appropriate) assings a priority to every thread of execution. There exist four classes of priority, and each class is divided into 32 priority levels. The system manages threads basically using the following operations:

  • Assigning the priorities and executing the threads (TIMESLICE). Threads of the same priority get the same chance to be processed;
  • Changing the thread priority (MAXWAIT).
This is called round-robin scheduling.

Object Snooze Time

The global variable OBJECTSNOOZETIME determines the snooze time of WPS objects (in seconds). This is the period of time the WPS will wait after an object is closed, before all the object DLLs will be unloaded from the memory, and hence the object will pass from the awakened to the dormant state. The default value if 90 seconds (it is not necessary to define it in CONFIG.SYS).