Enabling Parallel Apply During Install
Parallel apply is enabled using the svc-parallelization-type and channels options. The parallelization type defaults to
none which is to say that parallel apply is disabled. You should set it to disk. The channels option
sets the number of channels (i.e., threads) you propose to use for applying data. Here is a code example of a MySQL Applier
installation with parallel apply enabled. The replica will apply transactions using 30 channels.
[defaults]
install-directory=/opt/continuent
user=tungsten
mysql-allow-intensive-checks=true
profile-script=~/.bash_profile
application-port=3306
application-user=app_user
application-password=secret
replication-port=13306
replication-user=tungsten
replication-password=secret
connector-smartscale=false # parallel apply and smartscale are not compatible
svc-parallelization-type=disk
channels=10
rest-api-admin-user=apiuser
rest-api-admin-password=secret
connector-rest-api-address=0.0.0.0
manager-rest-api-address=0.0.0.0
replicator-rest-api-address=0.0.0.0
[alpha]
master=host1
members=host1,host2,host3
connectors=host1,host2,host3
topology=clustered
Show argument definitions
install-directory=/opt/continuentInstallation directory.user=tungstenOS System User, for example tungsten. DO NOT use root.mysql-allow-intensive-checks=trueFor MySQL installation, enables detailed checks on the supported data types within the MySQL database to confirm compatibility.profile-script=~/.bash_profileAppend commands to include env.sh in this profile script.application-port=3306Port for the connector to listen on.application-user=app_userDatabase username for the connector.application-password=secretDatabase password for the connector.replication-port=13306Database network port.replication-user=tungstenUser for database connection.replication-password=secretDatabase password.connector-smartscale=false # parallel apply and smartscale are not compatibleEnable SmartScale R/W splitting in the connector.svc-parallelization-type=diskMethod for implementing parallel apply.channels=10Number of replication channels to use for parallel apply.rest-api-admin-user=apiuserSpecify the initial Admin Username for API access.Available from v7.0.0rest-api-admin-password=secretSpecify the initial Admin User Password for API access. rest-api-admin-password alias only available from version 7.1.2 onwards.Available from v7.0.0connector-rest-api-address=0.0.0.0Address for the API to bind too.Available from v7.0.0manager-rest-api-address=0.0.0.0Address for the API to bind too.Available from v7.0.0replicator-rest-api-address=0.0.0.0Address for the API to bind too.Available from v7.0.0If the installation process fails, check the output of the /tmp/tungsten-configure.log file for more information about the
root cause.
There are several additional options that default to reasonable values. You may wish to change them in special cases.
buffer-size- Sets the replicator block commit size, which is the number of transactions to commit at once on replicas. Values up to 100 are normally fine.native-slave-takeover- Used to allow Tungsten to take over from native MySQL replication
You can check the number of active channels on a replica by looking at the "channels" property once the replicator restarts.
replica-shell> trepctl -service alpha status| grep channels
channels : 10
The channel count for a replica will ALWAYS be 1 because extraction is single-threaded:
primary-shell> trepctl -service alpha status| grep channels
channels : 1
Enabling parallel apply will dramatically increase the number of connections to the database server.
Typically the calculation on a replica would be: Connections = Channel_Count x Service_Count x 2, so for a 4-way Composite Active/Active topology, for example, with 30 channels there would be 30 x 4 x 2 = 240 connections required for the replicator alone, not counting application traffic.
You may display the currently used number of connections in MySQL:
mysql> SHOW STATUS LIKE 'max_used_connections'
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| Max_used_connections | 190 |
+----------------------+-------+
1 row in set (0.00 sec)
Below are suggestions for how to change the maximum connections setting in MySQL both for the running instance as well as at startup:
mysql> SET GLOBAL max_connections = 512;
mysql> SHOW VARIABLES LIKE 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 512 |
+-----------------+-------+
1 row in set (0.00 sec)
shell> vi /etc/my.cnf
max_connections = 512