June 30, 2015
Enabling COMMIT_DELAY Improves Linux Performance
A change in your configuration file can improve performance on Linux systems. FairCom continually researches performance and data integrity in our products providing you with the best possible database experience. Our most current advice suggests potential for much improved transaction performance.
You may remember that a limitation in all implementations of the Linux file system (Linux Kernel Bug Tracker – 5994) was causing occurrences of several c‑treeACE errors (64, 66, 96, and 571). These errors were seen when rebooting with the disk cache enabled (and without an uninterruptable power supply).
Because of this above mentioned “bug,” Linux ignored an O_SYNC file mode (used to secure data to disk) applied after a file was already opened, which caused disk writes to be retained in volatile file system cache instead of written to disk before the write call returns. It was also found that some Linux systems were configured in a way that did not guarantee data recoverability in the event of a power loss. This resulted in very fast performance, but did not provide intended data integrity. As a result, FairCom engineers defaulted our COMMIT_DELAY option to -1 (disabled), resulting in the fastest possible performance.
Commit delay controls the length of time (in milliseconds) after a given transaction completes before the transaction is flushed to disk. If more than one transaction completes before the delay period expires, they can be committed together, as a group, reducing disk-access overhead and improving overall throughput. Needless to say, it remained an oddity for some time that Linux performed so well without benefit of commit delay.
Commencing with c‑treeACE V10.3.1.20772 (Build 140216), c‑treeACE logic was changed, resolving this dilemma forcing an O_SYNC file mode at file open time. This change restored expected data integrity, along with an apparent reduction in performance as data is now correctly secured to disk (as intended) instead of file system cache.
FairCom’s on-going research into performance and data integrity further demonstrated reverting COMMIT_DELAY back to 1 millisecond improves TRNLOG performance on Linux systems as expected. As a result, a specified COMMIT_DELAY in default Linux configuration files is now 1 (ms).
What Does this Mean to Me?
If you are a Linux c‑treeACE Server administrator, you are encouraged to examine your current COMMIT_DELAY setting in your server’s configuration file. A simple change from -1 to 1 may likely improve performance when using these latest builds.
If you are using a COMMIT_DELAY setting other than -1 or 1, ensure that your choice was chosen for specific performance or recoverability considerations applied to your particular system. And, if you’re not using our latest c‑treeACE Server build with proper O_SYNC usage, you should contact your nearest FairCom office for availability.
Remember, the best configurations for your system depend on many factors. There is no substitute for performing tests to determine the best settings for your environment.
- Use the c‑treeACE Load Test Utility to get a general overview of performance on your system. This test program is supplied with the c‑treeACE Professional Developer’s Kit.
- Use your own application and sample data and directly test with different settings.
A FairCom WhitePaper explains this change and the Linux “bug” that prompted it: Linux File System Performance and Safety Advisory
- FairCom WhitePapers
- Linux File System Performance and Safety Advisory