Improved Performance of Server Index Node Lock
The FairCom Server logic has been enhanced to improve performance for concurrent connections that are updating the same index file. The performance of FairCom Server index node lock request collision handling has been improved by adjusting the logic to be more efficient.
This change has also been applied to data record write and read lock collision handling.
Faster Index Additions from ctdbAlterTable()
When ctdbAlterTable() is called to add new indexes without specifying a physical index name, c-treeDB adds them as members to the last physical index. To accomplish this, it dropped all existing indexes and rebuilt them including the new members.
ctdbAlterTable() now avoids rebuilding existing indexes whenever possible and simply adds new index members. This makes ctdbAlterTable() much faster when adding new indexes in many cases.
This change also improves IFIL content by avoiding storing unnecessary index names.
Improved Scalability for High Concurrency Index Leaf Node Reads
Performance analysis identified contention on index leaf node reads with many concurrent connections. A new configuration option improves scalability under these conditions. Specific testing on a Solaris system with many CPUs clearly shows large improvement. This modification affects the following index types:
With this configuration enabled, FairCom Server acquires a read lock on a leaf node if the index does not use key compression. If it finds that the node contains transaction marks, it releases the read lock and acquires a write lock on the node.
The FairCom Server configuration option LEAF_NODE_READ_LOCK accepts values of YES (to turn on this feature, which is the default) and NO (to turn off this feature). This configuration option is dynamically configurable at runtime by calling the ctSETCFG() function or using the ctadmn utility's option (menu option 10, and then menu option 10, Change the specified configuration option, again) to change a server configuration option value.
The graph below shows specific performance improvement. The green line is our starting point with a proprietary test, which is roughly 1,000 seconds at 250 concurrent connections. After our change, the performance characteristics on Solaris is around 100 seconds, an order of magnitude improvement.
Background Load on Index Creation
Background key loading can improve performance when adding new indexes. A new background loading mode can be OR-d in with an existing key mode from a ctdbAddIndex() call indicating initial index loading must be done in the background.
Once ctdbAddIndex() is called, ctdbAlterTable() initiates the changes to the file and begins the load once the new index is successfully created.
Check the status of index loading with the new ctdbCheckIndexBackgroundLoad() API, useful for monitoring index loading on tables.
Index Node Prune Feature - Ability to Deactivate Node Pruning
FairCom DB's delete-node thread prunes empty nodes from index files in the background. It densely packs key data for optimal index performance. To prevent index corruption, it runs during idle times and opens the index file exclusively, which prevents external processes from opening it.
To disable the "index node prune" feature, for example to allow an external process to open an index file, use the following keyword:
COMPATIBILITY NO_DELNOD_QUEUE
The above keyword prevents the delete-node thread from running, which prevents automatic index optimization, however, it allows external processes to open the index file.
Another keyword, COMPATIBILITY KEEP_EMPTY_NODE_ON_READ, prevents empty nodes read from disk being added to the delete queue. This is the V2/V11 and earlier behavior.
Extend Leaf Node Read Lock Optimization to Moving Right or Left at Leaf Level
When key lookup operations move right or left at the leaf level, the call to search the index cache for an index buffer that holds the specified node was not taking advantage of the leaf node read lock optimization. The logic has been modified to do this. This change could boost performance of key lookups when an index has empty leaf nodes for example.