Direct Replication for Inbound Commands

Reduce command transformation in the inbound replication path between the Replication Server EXEC and DIST modules to improve replication performance.

For inbound data, you can set cmd_direct_replicate on for the Executor thread to send internal parsed data along with the binary or ASCII format data. Replication Server stores the parsed data in a separate SQM command cache. The parsed data in the SQM command cache maps to the binary or ASCII format data stored in SQM cache. When required, the Distributor module can retrieve and process the internal format parsed data directly, and save time otherwise spent parsing binary or ASCII format data. Since parsing ASCII format consumes more resources, the reduction in command transformation and subsequent improved replication performance for ASCII format packed data is more than binary packed data. The default is off.

The Distributor thread can only read from the SQM command cache if at first the thread can read from the SQM cache instead of from physical disk, and if you set an appropriate SQM cache size with sqm_cache_size. Once the Distributor thread reads a command from the SQM cache, the ability of the thread to find an already parsed version of this command in the SQM command cache depends on the SQM command cache size that you set with sqm_cmd_cache_size, and the maximum number of entries in the SQM block that can be associated with parsed commands that you can set with sqm_max_cmd_in_block.

Use configure replication server to set cmd_direct_replicate at the server level for all Replication Agent connnections to databases. Otherwise, use alter connection to set the the parameter for individual connections. For the configuration to take effect if you use alter connection, restart Replication Agent. Restart Replication Server if you use configure replication server.

Use the sqm_cmd_cache_size and sqm_max_cmd_in_block parameters to set the the SQM command cache memory configuration. You can configure cmd_direct_replicate, sqm_cmd_cache_size and sqm_max_cmd_in_block in the same command or separately. Replication Server ignores the settings for sqm_cmd_cache_size and sqm_max_cmd_in_block if sqm_cache_enable is off.

Example 1

To set the configuration for all connections and queues for a 64-bit Replication Server:
configure replication server
set cmd_direct_replicate to 'on'
set sqm_cmd_cache_size to '40971520'
set sqm_max_cmd_in_block to '640'
go

Example 2

To set the configuration for the connection to the pdb1 primary database in the TOKYO_DS data server and for inbound queue number 2 for a 32-bit Replication Server:
alter connection to TOKYO_DS.pdb1
set cmd_direct_replicate to 'on'
go
alter queue 2, 1,
set sqm_cmd_cache_size to '2048576'
set sqm_max_cmd_in_block to '640'
go
Related concepts
Increase Queue Block Size
Monitor Performance Using Counters
Related reference
Configure Stable Queue Cache Parameters