Skip to content

Understanding the Parallel Import Mechanism in MySqlBackup.NET v2.6.2

adriancs edited this page Jul 12, 2025 · 6 revisions

Understanding the Parallel Import Mechanism in MySqlBackup.NET v2.6.2

Date: July 12th, 2025

This page includes test results that show small differences between the three import methods, but these differences are too small to matter in real world use. The import process is already limited by the MySQL server itself, which uses about 95% of the total time to process large amounts of data (which is the bottleneck). The small performance differences show that MySqlBackup.NET is already working at the most optimal state. Further improvements or optimization would not produce any further meaningful performance gain.

Note: Parallel processing is now enabled by default in v2.6.2

using (var conn = new MySqlConnection(constr))
using (var cmd = conn.CreateCommand())
using (var mb = new MySqlBackup(cmd))
{
    conn.Open();

    // enabled by default in 2.6, turn off this to run in legacy single thread
    mb.ImportInfo.EnableParallelProcessing = true;
    mb.ImportFromFile(@"C:\backup.sql");
}

Here's the illustration diagram:

MySqlBackup.NET v2.6.2 Import Single Thread


MySqlBackup.NET v2.6.2 Import Parallel Processing

Benchmark

Method Batch Test 1 Batch Test 2 Average
MySqlBackup.NET
Import Single Thread
66s 162ms
69s 610ms
70s 153ms
66s 387ms
70s 188ms
70s 137ms
68s 773ms
MySqlBackup.NET
Import Parallel
64s 063ms
64s 094ms
64s 469ms
65s 469ms
66s 141ms
65s 844ms
65s 013ms
mysql.exe 64s 625ms
62s 619ms
63s 016ms
66s 922ms
64s 516ms
64s 655ms
64s 392ms

Test Environment

Date Report              : July 12th, 2025

Hardware

Operating System         : Windows 10 Pro x64 (version 10.0.19045, build: 19045)
Processor                : Intel(R) Core(TM) i7-4770S CPU @ 3.10GHz (4 cores, 8 threads)
Hard Disk                : Samsung SSD 870 EVO 500GB
RAM                      : 16GB DDR3 1600Mhz

MySQL

Community Server         : 8.4.5
InnoDB Tables            : 5
Total Rows               : 685,000 rows
Database Size            : 680 MB
SQL Dump Size            : 978 MB (1.02 GB)
max_allowed_packet       : 999M
innodb_buffer_pool_size  : 512 MB (536870912 bytes)
Server Throughput        : 15.19 MB/sec, 10,637 rows/sec

Performance Results

mysql.exe                : 64.4s
MySqlBackup.NET          : 65.0s (+0.9%)  << Single Thread
MySqlBackup.NET          : 68.8s (+6.8%)  << Parallel Processing
Clone this wiki locally