COMPATIBILITY DIRECT_IO
COMPATIBILITY DIRECT_IOThe FairCom Server for Solaris uses O_DSYNC synchronous writes for the transaction logs when the COMPATIBILITY SYNC_LOG or COMPATIBILITY LOG_WRITETHRU configuration options are specified in the server configuration file.
Furthermore, it is expected the O_DSYNC writes are more efficient than O_SYNC writes. The FairCom Server uses O_DSYNC on systems that define this file open mode and uses O_SYNC on systems that do not define the O_DSYNC file open mode.
COMPATIBILITY DIRECT_IO, is available to revert to the previous behavior of direct I/O.
When the FairCom Server starts up, it writes either the message "Transaction logs using direct I/O." or "Transaction logs using synchronous I/O." to CTSTATUS.FCS to indicate which method of synchronous writes is in use. If neither COMPATIBILITY SYNC_LOG nor COMPATIBILITY LOG_WRITETHRU is specified in ctsrvr.cfg, neither of these messages is written to CTSTATUS.FCS as in that case the server performs asynchronous writes that are flushed by a separate call.
Default: OFF
Also See
COMPATIBILITY FDATASYNC
COMPATIBILITY FDATASYNCFor Unix systems, enables the optional use of fdatasync() instead of fsync().
COMPATIBILITY FORCE_WRITETHRU
COMPATIBILITY FORCE_WRITETHRUCOMPATIBILITY FORCE_WRITETHRU enables the WRITETHRU filemode for all non-transaction files (including PREIMG files, which are transaction controlled but do not have a transaction log).
Default:
This option is off by default. Be sure to check your FairCom Server configuration file, as it might be enabled there.
Note The performance impact of the WRITETHRU filemode depends on whether COMPATIBILITY PREV610A_FLUSH is enabled. See COMPATIBILITY PREV610A_FLUSH for details.
COMPATIBILITY PREV610A_FLUSH
COMPATIBILITY PREV610A_FLUSH COMPATIBILITY PREV610A_FLUSH suppresses the flushing of updated file system cache pages to disk when a non-transaction WRITETHRU file is updated. See COMPATIBILITY FORCE_WRITETHRU.
Default:
This option is off by default. Be sure to check your FairCom Server configuration file, as it might be enabled there.
The performance impact of WRITETHRU depends on whether COMPATIBILITY PREV610A_FLUSH is enabled:
- When COMPATIBILITY PREV610A_FLUSH is NOT enabled, each update to a non-transaction WRITETHRU file is flushed to disk. Both c-tree and operating system (OS) caches are flushed. This mode, while extremely safe, can significantly slow down performance of updates to non-transaction WRITETHRU files.
- When COMPATIBILITY PREV610A_FLUSH is enabled, each update to a non-transaction WRITETHRU file is flushed to the OS file system cache, but the updated pages in the OS file system cache are not flushed at the time of the update. This mode performs much faster than when each update flushes the file system cache updates to disk, but note that the contents of updated file system cache pages can be lost if the system loses power before the operating system has written the updated file system cache pages to disk. Installing a power supply on the system can reduce the likelihood of losing data in the event that a system power loss occurs by permitting time for the operating system to write updated file system cache pages to disk.
COMPATIBILITY WTHRU_UPDFLG
COMPATIBILITY WTHRU_UPDFLGDisables the ‘update’ flag on files with the WRITETHRU file mode. If COMPATIBILITY WTHRU_UPDFLG is not in its configuration file and if non-transaction files are opened without WRITETHRU in the file mode, a warning is issued in CTSTATUS.FCS concerning the vulnerability to FCRP_ERR (14).
Default: Not present
DEFAULT_CHANNELS
DEFAULT_CHANNELS <nbr of I/O channels>DEFAULT_CHANNELS changes the number of I/O channels assigned to a file with ctDUPCHANEL in its file mode at open, unless the file is in the SET_FILE_CHANNELS list. The default number of channels is not limited by the NUMCHANEL value.
Note Multiple I/O channels are disabled for newly created files. The multiple I/O channels take affect only on an open file call. Also, depending on the default number of I/O channels, a superfile host not in the SET_FILE_CHANNELS will use no more than 2 * NUMCHANEL I/O channels.
See Also
IDLE_NONTRANFLUSH and IDLE_TRANFLUSH
Note As of FairCom DB V11, these keywords have been replaced by the following keywords:
TRAN_DATA_FLUSH_SEC
NONTRAN_DATA_FLUSH_SEC
TRAN_INDEX_FLUSH_SEC
NONTRAN_INDEX_FLUSH_SEC
IDLE_TRANFLUSH <idle check interval seconds>
IDLE_NONTRANFLUSH <idle check interval seconds>FairCom DB flushes data and index caches during idle time, launching two idle thread processes at start-up: One thread flushes transaction-file buffers and the other flushes non-transaction-file buffers. The threads wake-up periodically and check if the FairCom Server is idle to begin flushing. Subsequent activity terminates the flushes. Low priority background threads, such as the delete node thread, do not affect the idle state, however, FairCom DB clients and transaction checkpoints modify the idle status.
Filesystem Flush Performance
Starting with V8 the default behavior of the idle flush threads was changed to skip internal filesystem flush calls for better performance when performing the idle flush operation. Flushing the filesystem buffers guarantees data is secured to disk at a performance cost. To revert this behavior, add the #SAVE option after the checkpoint time which will ensure data safety in nearly all cases. Note that flushing filesystem buffers will cause measurable delays when large caches are in use, and you may notice transaction slowdowns during this period.
IDLE_TRANFLUSH <idle check interval in seconds>#SAVE
IDLE_NONTRANFLUSH <idle check interval in seconds>#SAVEThe default interval is 15 seconds. Setting the interval to zero or a negative value disables the thread.
Default: 15 seconds
See Also
- DELAYED_DURABILITY
- TRAN_DATA_FLUSH_SEC
- NONTRAN_DATA_FLUSH_SEC
- TRAN_INDEX_FLUSH_SEC
- NONTRAN_INDEX_FLUSH_SEC
IO_BLOCK_SIZE
IO_BLOCK_SIZE <size>Splits disk read and write operations larger than the specified size into individual operations of the specified size. For example, specifying IO_BLOCK_SIZE 16 KB causes a 1 MB write request to be performed as 64 16 KB write operations.
See Also
IO_ERROR_BLOCK_RETRY
IO_ERROR_BLOCK_RETRY <retries>Specifies the maximum number of failed IO_ERROR_BLOCK_SIZE-sized I/O operations that must occur before the I/O operation is considered to have failed. If the IO_ERROR_BLOCK_SIZE-sized I/O operations that are being attempted for a particular I/O operation fail more than <retries> times, the FairCom Server writes a READ_ERR (36) or WRITE_ERR (37) message to CTSTATUS.FCS and considers the I/O operation to have failed.
A value of -1 signifies infinite retries. The default is 0, which means that the I/O operation is tried only once in IO_ERROR_BLOCK_SIZE-sized blocks, and if any of these I/O operations fails, the entire I/O operation is considered to have failed. As another example, if IO_ERROR_BLOCK_RETRY is set to 20 and IO_ERROR_BLOCK_SIZE is set to 65536, if a 327680-byte write is retried as 5 65536-byte write operations, then the I/O operation fails if there are 20 failures to perform those 5 write operations.
See Also
IO_ERROR_BLOCK_SIZE
IO_ERROR_BLOCK_SIZE <size>When the Windows kernel has allocated all of its paged-pool memory, it will not be able to perform many tasks and instead returns a STATUS_INSUFFICIENT_RESOURCES (0xC000009A) message. This is a restriction of 32-bit addressing (only 2GB addressable within the kernel), regardless of the amount of memory available in the system.
When the FairCom Server configuration option IO_ERROR_BLOCK_SIZE option is specified in the FairCom Server configuration file, a read or write operation that fails with Windows system error 1450 (ERROR_NO_SYSTEM_RESOURCES) is retried in blocks of the specified size. If any one of those read or write operations fails, the FairCom Server fails the read or write operation.
See Also
IO_ERROR_BLOCK_SLEEP
IO_ERROR_BLOCK_SLEEP <time>Specifies a time in milliseconds between IO_ERROR_BLOCK_RETRY retry attempts. The default is zero, which means that retries are attempted immediately.
See Also
NONTRAN_DATA_FLUSH_SEC
NONTRAN_DATA_FLUSH_SEC <time_limit_in_seconds>Sets the time limit in seconds that a data cache page can remain dirty before it is written to the file system cache.
- Specify IMMEDIATE to cause dirty pages to be written immediately.
- Specify OFF to disable time limit-based flushing.
Default: IMMEDIATE
See Also
NONTRAN_INDEX_FLUSH_SEC
NONTRAN_INDEX_FLUSH_SEC <time_limit_in_seconds>Sets the time limit in seconds that an index buffer can remain dirty before it is written to the file system cache.
- Specify IMMEDIATE to cause dirty pages to be written immediately.
- Specify OFF to disable time limit-based flushing.
Default: IMMEDIATE
See Also
OPEN_FILES_ALERT_THRESHOLD
OPEN_FILES_ALERT_THRESHOLD <files>Default: 0
FairCom Server now supports logging a diagnostic message to CTSTATUS.FCS whenever its total number of open files exceeds the specified threshold.
<files> is the number of open files at which FairCom Server should start logging messages to CTSTATUS.FCS. This option defaults to zero (no logging).
Once the limit is reached, a message is logged each time the current number of open files exceeds the previous high water mark. So for example, in the following situation:
OPEN_FILES_ALERT_THRESHOLD 100Current open files = 99
1. Open a file: current open files = 100: message logged
2. Open a file: current open files = 101: message logged
3. Open a file: current open files = 102: message logged
4. Close a file: current open files = 101
5. Open a file: current open files = 102: no message logged because already logged 102
This option can be changed at runtime via ctadmn.
OPTIMIZE_FILE_OPEN
OPTIMIZE_FILE_OPEN YES | NODefault: YES
Enables file open optimizations for improved performance and scalability. Currently the options can only be set in the configuration file. They cannot be changed at run time.
The following messages in CTSTATUS.FCS indicate that these optimizations are on:
File open optimization is enabled.The following messages in CTSTATUS.FCS indicate that these optimizations are off:
File open optimization is off.See Also
DIAGNOSTICS SYSTEM_FILE_ID_LIST
OPTIMIZE_FILE_CLOSE
OPTIMIZE_FILE_CLOSE YES | NODefault: YES
Enables file close optimizations for improved performance and scalability. Currently the options can only be set in the configuration file. They cannot be changed at run time.
The following messages in CTSTATUS.FCS indicate that these optimizations are on:
File close optimization is enabled.The following messages in CTSTATUS.FCS indicate that these optimizations are off:
File close optimization is off.See Also
DIAGNOSTICS SYSTEM_FILE_ID_LIST
PENDING_FILE_OPEN_RETRY_LIMIT
PENDING_FILE_OPEN_RETRY_LIMIT <limit>Default: 0 (wait forever) (before V12, 100000)
Sets the pending open retry limit. Normally, it is not expected a file open or create to exceed the pending file open retry limit, but this limit is provided to ensure the calling function returns an error after a limited number of retries in the unexpected case that a file remains in a pending open state for a long period of time.
It is possible to change the PENDING_FILE_OPEN_RETRY_LIMIT server setting at runtime in the usual ways (ctadmn and the ctSETCFG() API function).
See Also
DIAGNOSTICS SYSTEM_FILE_ID_LIST
SET_FILE_CHANNELS
SET_FILE_CHANNELS <file name>#<nbr of I/O channels>Without this feature, the ctDUPCHANEL file mode bit enables a file to use NUMCHANEL simultaneous I/O channels, where NUMCHANEL is set at compile time, and is by default, set to two (2). For superfile hosts with ctDUPCHANEL, 2* NUMCHANEL I/O channels are established. The default is not to turn on ctFeatCHANNELS.
SET_FILE_CHANNELS permits the number of I/O channels to be explicitly set for the named file regardless of whether the file mode, at open, includes ctDUPCHANEL. A value of one (1) for the number of I/O channels effectively disables ctDUPCHANEL for the file. A value greater than one (1) turns on DUPCHANEL and determines the number of I/O channels used. The number of I/O channels is not limited by the compile-time NUMCHANEL value. You may have as many SET_FILE_CHANNELS entries as needed.
The <file name> can be a wildcard specification using a ‘?’ for a single character and a ‘*’ for zero or more characters. See FairCom DB Standard Wildcards.
Note Multiple I/O channels are disabled for newly created files. The multiple I/O channels take affect only on an open file call. Also, depending on the default number of I/O channels, a superfile host not in the SET_FILE_CHANNELS will use no more than 2 * NUMCHANEL I/O channels.
See Also
SYSTEM_FILE_ID_LIST
SYSTEM_FILE_ID_LIST YES | NO Default: YES
Enables the system file ID list, which is used to detect files being opened using different aliases. It can be turned on or off at runtime when the server is in a quiesced state.
See Also
DIAGNOSTICS SYSTEM_FILE_ID_LIST
DIAGNOSTICS SYSTEM_FILE_ID_LIST
DIAGNOSTICS SYSTEM_FILE_ID_LISTEnables logging of adds/deletes to the system file ID list to the file SYSIDHASH.FCS in the server's LOCAL_DIRECTORY directory. Can be turned on or off at runtime.
See Also
TRAN_DATA_FLUSH_SEC
TRAN_DATA_FLUSH_SEC <time_limit_in_seconds>Sets the time limit in seconds that a data cache page can remain dirty before it is written to the file system cache.
- Specify IMMEDIATE to cause dirty pages to be written immediately.
- Specify OFF or -1 to disable the time limit-based flushing.
- In V11.4 and later, a rate limiting parameter can be specified as follows: "rate=<msec> / <number of flushes>"
For example, to defer for 1 millisecond after every two flushes of updated TRNLOG data cache pages, use this option:
TRAN_DATA_FLUSH_SEC rate=1/2
System snapshot 19 and later includes fields referencing background flush state structure, BGFLSS, which is in the system snapshot structure, ctGSMS. When a background flush thread is set to flush at a particular rate, the text snapshot shows the rate. For example:
time limit for dirty non-transaction data pages : rate=1/1This option can be changed using the ctSETCFG() API function or the ctadmn utility.
Note Enabling this option disables checkpoint flush operations.
Default: -1 (disabled)
See Also
TRAN_INDEX_FLUSH_SEC
TRAN_INDEX_FLUSH_SEC <time_limit_in_seconds>Sets the time limit in seconds that an index buffer can remain dirty before it is written to the file system cache.
Also, attempts to do routine optimization of index nodes as they are flushed to disk by background index flush. This is intended to improve overall index lookup performance and distinct key estimate accuracy.
- Specify IMMEDIATE to cause dirty pages to be written immediately.
- Specify OFF or -1 to disable the time limit-based flushing.
- In V11.4 and later, a rate limiting parameter can be specified as follows: "rate=<msec> / <number of flushes>"
For example, to defer for 1 millisecond after every two flushes of updated TRNLOG data cache pages, use this option:
TRAN_DATA_FLUSH_SEC rate=1/2
System snapshot 19 and later includes fields referencing background flush state structure, BGFLSS, which is in the system snapshot structure, ctGSMS. When a background flush thread is set to flush at a particular rate, the text snapshot shows the rate. For example:
time limit for dirty non-transaction data pages : rate=1/1This option can be changed using the ctSETCFG() API function or the ctadmn utility.
Note Enabling this option disables checkpoint flush operations.
Default: -1 (disabled)
See Also
COMPATIBILITY DISABLE_BACKGROUND_CLEANUP
UNBUFFERED_IO
UNBUFFERED_IO <filename>FairCom Server supports the use of unbuffered disk I/O operations on a per-file basis. Unbuffered I/O bypasses the file system cache and avoids double caching of data in the FairCom Server and the file system cache. The file name may include wildcard characters (see FairCom DB Standard Wildcards)
The UNBUFFERED_IO configuration option enables unbuffered I/O for the specified file. When the file is opened, the sector size of the disk on which the file resides is determined and it stores that sector size in the new file control block member.
Windows enforces the following restrictions for I/O when using unbuffered I/O:
- The file offset for the I/O operation must be a multiple of the disk sector size.
- The amount of data to be read or written must be a multiple of the disk sector size.
- The address of the buffer used in the I/O operation must be aligned on a disk sector size boundary.
For files that use unbuffered I/O, c-tree's file I/O function checks that these requirements are met. If not, logic is in place that makes the necessary adjustment by allocating a temporary buffer that is used in the I/O operation.
When a file is configured to use unbuffered I/O, the sector size of the disk on which the file is stored is checked and if it exceeds the server's page size. If so, the following message is logged to CTSTATUS.FCS and unbuffered I/O is not used on that file:
If an existing file is being opened:
mbopen: File <filename> disk sector size (<disk_sector_size>) exceeds page size (<page_size>)If a new file is being created:
mbcratx: File <filename> disk sector size (<disk_sector_size>) exceeds page size (<page_size>)Note Unbuffered I/O is not available for encrypted or segmented files and is ignored for those file types.
UNBUFFERED_IO completely avoids the file system cache. Compare to COMPATIBILITY TDATA_WRITETHRU, which uses the file system cache and then to disk before returning.
OS Support
This option is supported on the Windows operating system.
In V11 and later, support for direct I/O has been enabled on Linux systems. A value of 512-bytes is used for size and alignment for direct I/O.
This feature supports both c-tree data and index files, as well as transaction logs. Configuration options are provided for both.
- UNBUFFERED_IO filename (enables direct I/O for the specified file; the filename can include wildcards, such as *.dat)
- UNBUFFERED_LOG_IO YES (enables direct I/O for the transaction logs).
Note This feature requires Linux kernel version 2.6 or later, FairCom Server logs an error message to CTSTATUS.FCS if these options are used on pre-2.6 Linux kernel systems. The error messages are:
The UNBUFFERED_IO option requires Linux kernel version 2.6 or later
The UNBUFFERED_LOG_IO option requires Linux kernel version 2.6 or later See Also
DIAGNOSTICS DIRECT_IO
DIAGNOSTICS DIRECT_IOEnables a check on each write operation for a file for which direct I/O is requested that the properties of the write operation meet the direct I/O requirements. If not, the server logs one of the following messages to the server status log:
directIOdiag: Buffer address (<address>) not properly aligned for direct I/O...
directIOdiag: Write length (<length>) not properly sized for direct I/O...
directIOdiag: File offset (<offset>) not properly aligned for direct I/O...
DIAGNOSTICS LOWL_FILE_IO
DIAGNOSTICS LOWL_FILE_IOThe DIAGNOSTICS LOWL_FILE_IO server keyword logs low-level system errors into the server status file, CTSTATUS.FCS. Although client applications have access to system errors through sysiocod, it is useful to see these errors logged on the server side. Activating this feature causes a high decrease in performance.
This feature is also available at run time via the ctSETCFG() API call and passing in (setcfgDIAGNOSTICS, "LOWL_FILE_IO")
From the FairCom Server administrator utility, ctadmn, choose option 10, "Change Server Settings" and then option 9, "Change a DIAGNOSTICS option". Then enter LOWL_FILE_IO to enable. Precede with a '~' character to disable.
Default: Disabled