Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make DB backup use Zstandard compression.
Zstandard is a fast, modern, lossless data compression algorithm. For these backup files, it gives marginally better compression ratios than `gzip` and much faster compression and particularly decompression. We want the backup process to be quick as it's a CPU-intensive activity that could affect site performance. Experimental comparison of different compression utilities with their default settings: ``` Compression Test Results for 'latest-db.sqlite3': Method | Compression Time | Original Size | Compressed Size | Compression Ratio -------|------------------|----------------|------------------|------------------ gzip | Time: 272.43 s | Original: 4.1G | Compressed: 1.1G | Ratio: 73% XZ | Time: 3151.21s | Original: 4.1G | Compressed: 606M | Ratio: 86% 7Z | Time: 985.42 s | Original: 4.1G | Compressed: 616M | Ratio: 86% BZIP2 | Time: 462.39 s | Original: 4.1G | Compressed: 840M | Ratio: 80% ZSTD | Time: 30.14 s | Original: 4.1G | Compressed: 1.1G | Ratio: 75% ``` Zstandard is the clear best balance between speed and compression ratio. Any attempt to increase the compression ratio further, including flags to zstd, slowed the process significantly. If we were concerned about backup local space usage we should consider using additional or external storage, incremental backups, or a separate archival process.
- Loading branch information