Skip to content

Instantly share code, notes, and snippets.

@gnilchee
Last active August 30, 2015 06:35
Show Gist options
  • Save gnilchee/0ad57455fef43e1b8df0 to your computer and use it in GitHub Desktop.
Save gnilchee/0ad57455fef43e1b8df0 to your computer and use it in GitHub Desktop.
Most efficient log compression method?
[root@centos ~]# ls -lh
total 5.7G
-rw-r--r--. 1 root root 5.7G Aug 30 06:16 test.log
[root@centos ~]# xz -v -z test.log; gzip -v -9 test.log.xz
test.log (1/1)
100 % 880.5 KiB / 5,755.4 MiB = 0.000 6.3 MiB/s 15:13
test.log.xz: 96.8% -- replaced with test.log.xz.gz
[root@centos ~]# ls -lh
total 28K
-rw-r--r--. 1 root root 28K Aug 30 06:16 test.log.xz.gz
[root@centos ~]# gunzip test.log.xz.gz
[root@centos ~]# ls -lh
total 884K
-rw-r--r--. 1 root root 881K Aug 30 06:16 test.log.xz
[root@centos ~]# xz -v -d test.log.xz
test.log.xz (1/1)
100 % 880.5 KiB / 5,755.4 MiB = 0.000 167 MiB/s 0:34
[root@centos ~]# ls -lh
total 5.7G
-rw-r--r--. 1 root root 5.7G Aug 30 06:16 test.log
[root@centos ~]#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment