Use the fully asynchronous execution feature of PolarDB

Updated at:

This topic describes the features of the asynchronous execution architecture.

Prerequisites

  • To use the asynchronous authentication feature, your cluster must meet one of the following version requirements:

    • PolarDB for MySQL 8.0.2, revision 8.0.2.2.23 or later.

    • PolarDB for MySQL 8.0.1, revision 8.0.1.1.42 or later.

  • To use the asynchronous logging feature, your cluster must be PolarDB for MySQL 8.0.2, revision 8.0.2.2.29 or later.

Note

Enabling the asynchronous execution feature for PolarDB for MySQL requires support from the Alibaba Cloud backend. To enable or configure this feature, join the DingTalk group 63840000309 for assistance.

Parameters

Parameter name

Level

Description

loose_thread_pool_async_auth

Global

Specifies whether to enable the asynchronous authentication feature.

  • OFF (default): Disables the feature.

  • ON: Enables the feature.

loose_thread_pool_async_switch

Global

Controls the scheduling of asynchronous task execution.

  • async_basic: Enables asynchronous execution but does not perform asynchronous scheduling.

  • async_redo_log_flush: Asynchronously flushes redo logs during transaction commits. The atomicity, consistency, isolation, and durability (ACID) properties of transactions are guaranteed after this is enabled.

  • async_row_lock_wait: Enables asynchronous row lock waits.

  • async_binlog_group_commit: Asynchronously writes to binary logs (binlogs).

loose_thread_pool_ct_cache_size

Global

The number of asynchronous tasks to cache. A larger value can improve asynchronous execution performance but consumes more memory.

Value range: 1 to 100000. Default value: 100. Unit: bytes.

Asynchronous execution statistics

The information_schema.thread_pool_wait_status table has been added to collect statistics on wait events during SQL execution. This table contains the following fields:

Column

Description

ID

The ID of the asynchronous execution group.

WAIT_AUTH_HS_RESP

The number of connections for which authentication is being processed asynchronously.

WAIT_REDO_LOG_FLUSH_ASYNC

The number of connections for which logs are being asynchronously flushed to disk.

WAIT_ROW_LOCK_ASYNC

The number of connections waiting for row locks that are being processed asynchronously.

Example

After you enable the async_redo_log_flush feature, you may see information similar to the following. This information indicates the current number of connections that are asynchronously waiting for logs to be flushed to disk.

image