Skip to content

feat: optimize memory usage for parallel database dump#854

Merged
Soner (shyim) merged 4 commits intoshopware:mainfrom
nussjustin-hmmh:parallel-dump-optimization
Feb 17, 2026
Merged

feat: optimize memory usage for parallel database dump#854
Soner (shyim) merged 4 commits intoshopware:mainfrom
nussjustin-hmmh:parallel-dump-optimization

Conversation

@nussjustin-hmmh
Copy link
Copy Markdown
Contributor

@nussjustin-hmmh Justin Nuß (nussjustin-hmmh) commented Feb 17, 2026

The previous implementation would buffer all generated SQL in memory before writing to a file / stdout, which could use a lot of memory, even for relatively small databases.

The new implementation avoids this problem by first dumping the tables into temporary files and than copying the data from those files into the final file / stdout as soon as possible.

In my tests using, a local database, the max RSS went from 13712388 kbytes (!) to 73844 kbytes while also taking less time (~32.4s vs ~25.5s).

Comment thread internal/mysqldump/mysql.go Outdated
@shyim Soner (shyim) merged commit 10f751f into shopware:main Feb 17, 2026
3 checks passed
@nussjustin-hmmh Justin Nuß (nussjustin-hmmh) deleted the parallel-dump-optimization branch February 17, 2026 12:59
@shyim
Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants