Problem
SCO OpenServer 5.0.4 incorporates the functionality provided by the Large Server Supplement (LSS) 1.1.0, which has been obsoleted. SCO OpenServer 5.0.4 includes the following enhancements to the 'ht' filesystem driver for tuning HTFS, EAFS, AFS and S51K filesystems:
- Pre-allocating data blocks to files - Restricting cluster read-aheads - Setting the delayed-write buffer cancellation threshold
Solution
Below is the necessary 'ht' filesystem tuning documentation.
Enhanced support for filesystem tuning
======================================Pre-allocating data blocks to files
-----------------------------------The variable htdoprealloc (set in /etc/conf/pack.d/ht/space.c) controls how the ht filesystem driver pre-allocates data blocks when writing files. As a file is written, the driver pre-allocates data blocks in clusters so reducing the overhead needed by subsequent write operations. Additionally, the driver can use block address maps for regular files. This allows the driver to perform logical to physical block address translations more quickly when accessing a file. Using block address maps increases the performance of operations that need to access the same region of a file by reducing the need to traverse the file structure on disk. This is particularly effective with large files where indirect disk blocks may be involved. The expense incurred is that of requiring more memory to implement the maps.
If htdoprealloc is set to 0, the ht driver pre-allocates some blocks but it does not use block address maps.
If htdoprealloc is set to 1, the ht driver pre-allocates more blocks and uses block address maps. The driver also does not read pre-allocated blocks into the buffer cache immediately but defers this until the blocks are required. This can reduce the amount of disk I/O that is performed, and also reduces the contention for access to the buffer cache.
NOTE: We recommend that htdoprealloc is only set to 1 on systems with at least 64MB of memory, and which are running applications that access large regular files. Applications that access device special files or directories will not gain any advantage.
Restricting cluster read-aheads
-------------------------------The variable ht_restrict_readahead (set in /etc/conf/pack.d/ht/space.c) controls the threshold at which the ht filesystem driver reads ahead from disk clusters for HTFS, AFS, EAFS, and S51K filesystems.
If ht_restrict_readahead is set to 0, the ht driver always reads ahead.
If ht_restrict_readahead is set to 1, the ht driver does not perform read-aheads for reads of less than 4KB though it will still read ahead for larger reads. If the ht driver does not perform read-aheads for small reads, this can reduce unnecessary disk I/O for applications that perform a large number of small reads to non-sequential areas of a file.
Setting the delayed-write buffer cancellation threshold
-------------------------------------------------------The variable ht_cancelthresh (set in /etc/conf/pack.d/ht/space.c) controls the delayed-write buffer cancellation threshold for HTFS, AFS, EAFS, and S51K filesystems.
Systems with large (greater than 6MB) heavily-used buffer cache may see a disk I/O performance hit when removing or truncating large files in HTFS, AFS, EAFS, and S51K filesystems. The ht filesystem driver marks buffers belonging to files which are being deleted or truncated as delayed-write and then adds them to the tail of the free list.
During its periodic processing of outstanding file transactions, the htepi_daemon will normally mark the buffers as invalid to prevent their contents being flushed to disk. However, if there is high demand for buffers on the free list, it is possible that another process will take the delayed-write buffers belonging to the deleted or truncated file from the free list before the htepi_daemon has a chance to run. In such a case, the contents of the buffer are flushed to disk before the buffer is reassigned. This can lead to unnecessary disk I/O. To prevent this, the ht driver marks buffers as invalid (that is, it cancels delayed writing of the buffers) when a file greater than a certain size is deleted or truncated.
The limiting file size is controlled by the value of ht_cancelthresh. This variable defines the limiting file size as a percentage of the size of the buffer cache and can take any integer value from 0 through 100. The default value is 10% although a lower limit of 200KB is enforced. A value of 100% prevents delayed-write buffers being canceled. The side effect of canceling delayed-write buffers is that it temporarily prevents other processes from accessing the buffer cache. Setting the threshold to a low value increases contention for access to the buffer cache. Setting the threshold to a high value may increase the amount of unnecessary disk I/O.
NOTE: After changing the value of any driver variable, you must relink the kernel and reboot the system for the change to take effect.