Configuring Load Balancing for Publication Service
At run time, the Publication Service services of the same load balancing group create a mutex table that was configured in the load balancing group, poll the same publishing table, and distribute loads. The Publication Service services synchronize by locking the mutex table to obtain and update the sequence information.
Note: For Sybase, load balancing for Publication Service requires the
ddl in tran option to be set to
true. For example,
sp_dboption
database_name, "ddl in tran", true
Procedure
Click
test_pub1.adadbmodel in the
Project Explorer view and click the
Adapter Services tab.
Select the created Publication Service from the
All Adapter Services panel.
In the
Configuration tab, specify the name in the
Subject or
Destination field. For example,
test_loadbalancing_pub.
In the
Publication Options tab, select the
Use Polling Batch Size check box, and set a value in the
Polling Batch Size(Maximum Rows) field.
Select the
Enable Load Balancing check box, and the
Mutex Name field is displayed.
Select one of the following ways to create the mutex table:
Enter a name in the
Mutex Name field, and Publication Service will create a mutex table. For example,
test_pub.
Define a mutex table in your database and then enter the mutex table name in the
Mutex Name field. For example, you can use the following SQL statement to create a mutex table in the load balancing mode:
CREATE TABLE test_pub (COL1 INT)
The following figure shows the configuration in the
Publication Options tab:
Save the project.
Repeat
Step 1 to
Step 7 to configure load balancing in Publication Service test_pub2.