The recovery time objective (RTO) is the maximum time allowed to restore service after a failure. It is a core metric for measuring database high availability. When an RDS instance running AliSQL crashes, every second of recovery delay affects your applications. AliSQL optimizes six stages of the crash recovery pipeline—from tablespace discovery through transaction rollback—so that instances restart faster and become available sooner.
Optimization overview
AliSQL targets six stages of the crash recovery pipeline. Each optimization is independent. Together, they reduce total RTO across the full recovery sequence.
| Optimization | Recovery stage | Improvement |
|---|---|---|
| Massive table startup optimization | Tablespace discovery | Normal startup reduced by 73%; crash recovery reduced by >95%; memory usage reduced by >81% |
| Buffer pool initialization acceleration | Buffer pool initialization | Initialization time reduced by >80% |
| Parallel redo log application | Redo log application | Application time reduced by >80%; speed increased by >500% |
| Fast transaction recovery | Transaction resurrection (undo log scanning) | Recovery time for 1-million-record transactions reduced to ~0 s |
| Asynchronous transaction rollback | Uncommitted transaction rollback | Rollback time for 1-million-record transactions reduced to ~0 s |
| Optimization of General Query Log recovery | General Query Log corruption repair | Recovery time for a 10 GB log table reduced to ~0 s |
Massive table startup optimization
When an RDS instance contains a large number of tables—such as 1 million tables—tablespace checking during startup consumes significant time and memory. The instance must open and verify every tablespace file before it can serve traffic, which means startup time grows linearly with table count. AliSQL optimizes file scanning, data dictionary reading, and table object construction to reduce both startup time and memory usage.
Performance
| Scenario | MySQL Community Edition | AliSQL | Improvement |
|---|---|---|---|
| Normal startup time | 90.7 s | 24.1 s | Reduced by >73% |
| Crash recovery time | 521.7 s | 25 s | Reduced by >95% |
| Memory usage during startup | High | — | Reduced by >81% |
How to enable
| Requirement | Details |
|---|---|
| Minor engine version | MySQL 8.0: 20240731 or later |
| Key parameter | loose_fetch_raw_tablespace_at_startup — enabled by default. When enabled, only necessary metadata is loaded at startup; loading of redundant information is deferred. This reduces both memory usage and startup time. |
Buffer pool initialization acceleration
The buffer pool is the core memory structure of InnoDB. When an instance starts after a crash, the buffer pool is empty—all data must be read from disk until the cache warms up. Initializing a large buffer pool takes additional time: memory must be allocated and management structures built. MySQL Community Edition supports parallel initialization, but concurrency bottlenecks in lock structures and global statistics updates limit its effectiveness. AliSQL eliminates these bottlenecks to significantly reduce initialization time.
Performance
| Scenario | MySQL Community Edition | AliSQL | Improvement |
|---|---|---|---|
| Time to initialize a 512 GB buffer pool | 19.7 s | 3.8 s | Reduced by >80% |
How to enable
| Requirement | Details |
|---|---|
| Minor engine version | MySQL 8.0: 20220530 or later; MySQL 5.7: 20230531 or later |
| Key parameter | innodb_buffer_pool_init_optimize — enabled by default. When enabled, the system eliminates lock and synchronization bottlenecks during parallel buffer pool initialization. |
Parallel redo log application
Redo logs are the write-ahead logging (WAL) mechanism MySQL uses to ensure data consistency. Redo log scanning and application are the most time-consuming steps in crash recovery. MySQL Community Edition processes them on a single thread using serialized application—recovering 4 GB of redo logs can take several minutes. AliSQL introduces a pipeline mechanism that parallelizes both scanning and application, dramatically improving throughput.
Performance
| Scenario | MySQL Community Edition | AliSQL | Improvement |
|---|---|---|---|
| Time to apply 4 GB of active redo logs | 118.7 s | 22.6 s | Reduced by >80% |
| Application speed | Baseline | — | Increased by >500% |
How to enable
| Requirement | Details |
|---|---|
| Minor engine version | MySQL 8.0: 20241231 or later |
| Key parameter | innodb_parallel_redo_threads — default value is 1 (disabled). Set to a value greater than 2 (for example, 4) to enable parallel redo log scanning and application. |
How to verify
After setting innodb_parallel_redo_threads, confirm that the parameter is active:
SHOW GLOBAL VARIABLES LIKE 'innodb_parallel_redo_threads';The output should show the value you configured (for example, 4).
Fast transaction recovery
After redo logs are applied, MySQL uses undo logs to recover table locks for active transactions. MySQL Community Edition scans all undo log records row by row to identify which tables each transaction holds locks on. For transactions with millions of records, this scan adds significant delay before the instance can accept connections. AliSQL extends the undo log record structure to enable fast locating and scanning, reducing recovery time to near zero even for large transactions.
Performance
| Scenario | MySQL Community Edition | AliSQL | Improvement |
|---|---|---|---|
| Time to recover a transaction with 1 million records | 6.8 s | ~0 s | Completely optimized |
How to enable
| Requirement | Details |
|---|---|
| Minor engine version | MySQL 8.0: 20230630 or later; MySQL 5.7: 20230831 or later |
| Key parameter | innodb_trx_resurrect_table_lock_accelerate — default value is OFF. Set to ON to enable fast undo log scanning for large transaction recovery. |
How to verify
After setting innodb_trx_resurrect_table_lock_accelerate, confirm that the parameter is active:
SHOW GLOBAL VARIABLES LIKE 'innodb_trx_resurrect_table_lock_accelerate';The output should show ON.
Asynchronous transaction rollback
MySQL uses internal XA transactions to keep binary logs and InnoDB consistent. During crash recovery, transactions in the prepared state—where InnoDB completed its prepare phase but the commit was not written to the binary log—must be rolled back. In MySQL Community Edition, this rollback is synchronous: the instance blocks until all rollbacks complete before accepting connections. For large transactions with millions of records, this significantly delays restart. AliSQL moves uncommitted transaction rollback to the background. The instance becomes available immediately after crash recovery, and rollback continues without blocking service.
Performance
| Scenario | MySQL Community Edition | AliSQL | Improvement |
|---|---|---|---|
| Time to roll back a transaction with 1 million records | 100 s | ~0 s (instance available immediately) | Completely optimized |
How to enable
| Requirement | Details |
|---|---|
| Minor engine version | MySQL 8.0: 20220530 or later; MySQL 5.7: 20230531 or later |
| Key parameter | async_binlog_recovery — enabled by default. When enabled, uncommitted transaction rollback runs in the background so the instance can start accepting requests without waiting for rollback to finish. |
Optimization of General Query Log recovery
In TABLE mode, the MySQL General Query Log records user operations in a CSV table. If this table is corrupted at startup, MySQL Community Edition performs a full table scan to locate and rebuild the corrupted data. For a 10 GB log table, this scan takes over four minutes and delays instance availability. AliSQL uses reverse scanning and file truncation to quickly locate and repair the corruption, reducing recovery time to near zero.
Performance
| Scenario | MySQL Community Edition | AliSQL | Improvement |
|---|---|---|---|
| Time to recover a 10 GB General Query Log table | 270 s | ~0 s | Completely optimized |
How to enable
| Requirement | Details |
|---|---|
| Minor engine version | MySQL 8.0: 20241130 or later; MySQL 5.7: 20241130 or later |
| Key parameter | reverse_repair_general_log_on_boot — enabled by default. When enabled, the system uses reverse scanning and file truncation to accelerate General Query Log table recovery. |
Other optimizations
AliSQL also optimizes the process of verifying data in the doublewrite buffer. Update the minor engine version to the latest version to get all available optimizations.