5.4.9 The autotune Command

autotune [--dryrun] [--sequential-restart] [--writeload=writeload] template cluster_name

writeload:
    {low|medium|high}

template:
    {web|realtime|test}

The command autotune a number of parameters for the cluster according to the specified values for the template argument and the [optional] writeload option, in order to optimize the cluster's performance.

The valid values for template are:

  • web: Maximize performance for the given hardware.

  • realtime: Maximize performance while maximizing sensitivity to timeouts in order to minimize the time needed to detect failed cluster processes.

  • test: Minimal resource usage for small-scale testing. Not intended for production environments.

The valid values for --writeload are:

  • low: The expected load includes fewer than 100 write transactions for second.

  • medium: The expected load includes 100 to 1000 write transactions per second. This is the default value used when --writeload is not specified.

  • high: The expected load includes more than 1000 write transactions per second.

The cluster must be in the created or fully operational status for this command to work, or an error will result. The command tunes the cluster by issuing a number of set commands to adjust different parameters, and then performs a rolling restart for the cluster. Use the --sequential-restart option to make the rolling restart a sequential one.

When the --dryrun option is used, the command does not make any actual changes to the cluster, but writes the set commands that it will issue for tuning into the file /path-to-mcm-data-repository/clusters/clustername/tmp/autotune.message_id.mcm.

mcm> autotune --dryrun --writeload=high realtime mycluster;
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Command result                                                                                                                                                     |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Autotuning calculation complete. Please check /opt/mcm_data/clusters/mycluster/tmp/autotune.30fcce24_2184_0.mcm on host flundra for settings that will be applied. |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.62 sec)

$> cat /opt/mcm_data/clusters/mycluster/tmp/autotune.30fcce24_2184_0.mcm
# The following will be applied to the current cluster config:
set HeartbeatIntervalDbDb:ndbmtd=1500 mycluster;
set HeartbeatIntervalDbApi:ndbmtd=1500 mycluster;
set RedoBuffer:ndbmtd=64M mycluster;
set SharedGlobalMemory:ndbmtd=20M mycluster;
set DataMemory:ndbmtd=83886080 mycluster;
set IndexMemory:ndbmtd=18874368 mycluster;
set MaxNoOfExecutionThreads:ndbmtd=2 mycluster;
set FragmentLogFileSize:ndbmtd=256M mycluster;
set NoOfFragmentLogFiles:ndbmtd=3 mycluster;

After checking out those changes in the .mcm file, if you do not want to apply all of them to your cluster, you can edit the .mcm file as desired, and then execute it at the mcm client (see Section 4.5.2.3, “Creating and Configuring the Target Cluster” for how to do that). If you are happy with all the changes described in the file, issue the autotune command again without the --dryrun option, to perform the tuning:

mcm> autotune --writeload=high realtime mycluster;
+-----------------------------------------------------+
| Command result                                      |
+-----------------------------------------------------+
| Cluster successfully autotuned to template realtime |
+-----------------------------------------------------+
1 row in set (2 min 58.09 sec)