The tips in this section can be implemented using client-side configuration keywords in the ctree.conf file. For server-side configuration (using ctsrvr.cfg), the general FairCom Server configuration suggestions apply to FairCom RTG.
Note: These tips require changes to the FairCom RTG configuration file (ctree.conf). They should be performed only by a developer or administrator who is familiar with your installation and with FairCom RTG configuration keywords.
The <optimisticadd> option enables adding keys before the data during WRITE operations. When <optimisticadd> is disabled, c-tree attempts to add unique keys before adding the data record. This eliminates the overhead of deleting a data record when the unique key check fails, speeding up the insert process. Disable <optimisticadd> if the COBOL application frequently performs WRITE operations conflicting with existing records.
Transaction Logging
In FairCom RTG V11 (but not the default isCOBOL installation), it can be helpful to disable transaction logging if transactions are not used. You can completely disable transactions if data is stored on secure media (hardware redundancy, etc.).
ctutil -tron, ctcbtran, cttrnmod (cttrnmod - Change Transaction Mode Utility, /doc/ctreeplus/cttrnmod-ChangeTransactionModeUtility.htm), the <transaction> keyword, and the section titled Transaction Processing Notes provide information about changing the transaction mode and transaction logging.
Enabling the <ctfixed> option forces creating fixed-length record data files as fixed-length c-tree files. If you enable <ctfixed>, you may see a small performance enhancement as there is additional overhead in processing variable-length record data files.
FairCom RTG allows data compression so that less disk space is used, which results in performance enhancements while reading and writing to disk. Enabling <datacompress> using the RLE algorithm provides the advantages of compressed data with a very small impact on CPU usage. Since most applications are saturated at the I/O level, the slight increase in CPU usage but less overhead on the I/O channel typically results in performance gains. Note that RLE compression (which is the default) is usually the fastest algorithm.
Use <filepool> if files are frequently opened and closed. In COBOL applications it is common practice to close and re-open files for each procedure, which can cause unnecessary overhead. The <filepool> option keeps files open when the COBOL application requests to close them, allowing them to be available immediately when needed. Note: This may cause unexpected “file locked” situations when trying to open a file in exclusive mode if that file is kept open by the file pooling logic by another application.
Use the <prefetch> option to improve performance of sequential reads. This option enables batch record retrieval to improve performance of consecutive sequential reads. It retrieves a specified number of records on the second consecutive sequential read. The next sequential read operations do not need to contact the server to retrieve records because they are now cached on the client side. Note: This might cause locking conflicts when an application attempts to write a record that has been prefetched and still buffered on the client.
ACUCOBOL in RM/COBOL Compatibility Mode
Some installations use ACUCOBOL in RM/COBOL compatibility mode so that reads on locked records are expected to be blocked until the lock goes away (or a timeout is reached). If you are using this mode, you may find it beneficial to use <retrylock> and <locktimeout> to avoid the COBOL runtime polling the server to check for locks. ACUCOBOL runtime implements blocking locks by attempting the lock in a loop (by performing multiple requests) until the lock is released or the timeout expires. Using <retrylock> avoids a lot of communication traffic by having the server waiting on a lock.
See the documentation for <retrylock> and <locktimeout>.
Use <memoryfile> on temporary files that do not need to be shared among applications. Use <temporary> on temporary files that may be shared among applications. Files set as <memoryfile> are not persisted to disk at all. Files set as <temporary> are persisted on disk but there is no guarantee of their consistency in case of disaster.
See the documentation for <memoryfile> and <temporary>.
KEEPOPEN
The FairCom Server KEEPOPEN configuration option (which can be enabled in ctsrvr.cfg) can improve performance if the application is frequently using OPEN/CLOSE.
See the KEEPOPEN keyword in the FairCom Server Administrator's Guide.
The Shared Memory communication protocol can provide improved performance for clients and servers residing on the same machine.
SQL Data
See the section titled SQL Considerations to understand the performance impact of hard-to-sqlize data.
The <batchaddition> keyword can be used to improve performance of consecutive record additions by caching the records on the client and sending to the server in one batch operation.
The <bulkaddition> keyword can improve performance of consecutive record additions by writing only the data record and postponing the key addition until the file is closed
<datacompress> and <keycompress>
The <datacompress> and <keycompress> keywords to reduce disk space utilization and network traffic with a potential impact on performance.
The <optimisticadd> keyword enables and disables adding keys before the data during WRITE operations, which may improve performance in some situations.
The <prefetch> keyword enables batch record retrieval to improve performance of consecutive sequential reads.
The <smartcopy> keyword enables the use of batched read/write techniques to improve performance of file copy operations.
Performance Monitoring with ctstat
The performance of FairCom RTG can be monitored using the FairCom DB Statistics Utility, ctstat. This utility displays statistics collected by the FairCom DB server and provides valuable real time monitoring of critical FairCom DB operations.
The ctstat -func option displays the Function Timing Report, which shows the statistics for each c-tree function that a client has called at least once since the time the server started. You can learn more about this utility in the monitoring sections of the FairCom DB Server Administrator Guide, Function Timing Report Example.
This information is also available in the Function Timing tab of the FairCom DB Monitor.
Using this report, you can profile FairCom RTG operation to see where the system is spending the most time. This information can provide insight into the efficiency of your application. For example, an application that opens and closes a file for every read might be made more efficient if it keeps the file open during a long series of reads, assuming other considerations allow this (e.g., does the file need to be closed between reads for other reasons). In this example, performance may improve using the FairCom DB KEEPOPEN configuration option. See Troubleshooting Performance for more tips.
The FairCom RTG driver uses a number of custom functions that can be seen when using ctstat -func. To help you better understand this report, the list below describes the COBOL operations that map to these functions and what they accomplish:
- RTG_MAKE - create file
- RTG_OPEN - open file
- RTG_CLOSE - close file
- RTG_WRITE - add record
- RTG_READ - random read record
- RTG_START - position record
- RTG_NEXTPREV - sequential read record
- RTG_REWDEL - rewrite or delete record
- RTG_DELETE - delete records
- RTG_UNLOCK - unlock record
- RTG_VERSION - get server version
- RTG_SQLINFO - get or set SQL information
- RTG_SQLLINK - link or unlink file to SQL dictionaries
- RTG_COPY - copy file
- RTG_INFO - get file information
- RTG_ADDIDX - add index to file
Additional Monitoring Tools
FairCom RTG provides additional tools to aid in monitoring the performance of your system:
- FairCom DB Monitor - Monitors Server activity, events, configuration settings, connected users, etc. Displays the function timings described in the Performance Monitoring with ctstat section of the FairCom RTG COBOL User Guide.
- FairCom DB Gauges - A utility designed to display a wide array of performance metrics for analyzing the performance of the FairCom DB Server.
- FairCom DB Performance Monitor - Performance graphs showing FairCom DB data throughput. You can create multiple instances of the tool for monitoring a large quantity of metrics.
Benchmarking
- <log> and <profile> - Keywords to log performance profiling information.
- FairCom DB Load Test - A benchmark utility that measures the performance of record inserts, reads, and deletes in a given set of FairCom DB data files.
- ct_tpc and cttpca TPC A Test - Sample programs implementing the TPC (Transaction Processing Council) A test for benchmarking or comparing performance.