Is it possible to speed up the
mysqldump "$database_name" | gzip > $BACKUP_DIR/$database_name.sql.gz
to backup a database into a directory,
the manpage says:
-# --fast --best
Regulate the speed of compression using the specified digit #, where -1 or --fast indi‐ cates the fastest compression method (less compression) and -9 or --best indicates the slowest compression method (best compression). The default compression level is -6 (that is, biased towards high compression at expense of speed).
- How effective would it be to use
- Is this effectively lowering the CPU usage on a modern computer?
My test results
I didn't notice any acceleration:
- 7 min, 47 seconds (with default ratio
- 8 min, 36 seconds (with ratio
--fast( = 9 ))
So it seems it takes even longer to use the fast compression?
Only higher compression really slows it down:
- 11 min, 57 seconds (with ratio
--best( = 1 ))
After getting the Idea with
lzop I tested that too and it really is faster:
- 6 min, 14 seconds with
lzop -1 -f -o $BACKUP_DIR/$database_name.sql.lzo