Replication Log Reader

The log reader provides switches to help improve log reader performance during replication.

The log reader moves replication data from the publisher to the distributor, so that data can later be replicated to subscribers. The data is inserted into the distribution database in transactions. The amount of data that is transferred within each transaction is controlled by log reader -b, -c, and -t parameters.

Large batch sizes(-b, -c) move data out of the transaction log more quickly than small batch sizes. However, large batch inserts into the distributed database can cause subscriber tasks to block, waiting for access to the data. You must tailor the log reader parameters for optimal performance.

The following switches control the behavior of the log reader task. Although the transaction batch size -b and commit batch size -c parameters are included in the following table, only the command threshold parameter -t is new for SQL Server 6.5.

Switch parameter Description
-b Specifies the transaction batch size. This parameter determines the maximum number of transactions that are read out of the log before the log reader begins the COMMIT TRANSACTION process. The default is 100.
-c Specifies the commit batch size. This parameter determines how many transactions are placed in the distribution database before a COMMIT TRANSACTION can be issued in the distribution database. The default is 100.
-t Specifies the command threshold. This parameter determines the number of commands within a transaction to accept before a COMMIT TRANSACTION can be issued in the distribution database.

When this threshold number is exceeded, the log reader moves to commit the transaction even though the number of transactions may not have exceeded the commit batch size. In this way, you can improve distribution database access for subscribers.

When the parameter value is missing or 0, the command threshold logic is not applied to the log reader process.


In SQL Server 6.5, the log reader will commit the current batch of jobs to the distribution database if:

The command threshold parameter can lessen the impact of large transactions by allowing the log reader to commit the transactions as soon as they are completely processed instead of waiting for all pending transactions to be processed.

Important If you are not experiencing subscriber access delays, you should not set these parameters.

    To set the log reader parameters
  1. Stop SQL Executive if it is running.
  2. From the Server Manager window, select a server and then from the toolbar, choose the Manage Scheduled Tasks button. Or, from the Server menu, choose Scheduled Tasks.

    The Manage Scheduled Tasks window appears.

  3. Choose the New Task button to display the New Task dialog box. Or from the task list, select the log reader task and then choose the Edit Task button.

    The Edit Task dialog box appears.

  4. Modify text in the Command box as necessary.
  5. Choose Add or Modify.