Use gzip for snapshots
On the 15G snapshot data gz is 10 times faster than xz while compression rate is just 36% against 50% with gzip. For the pattern "create once - download once" this looks like a reasonable solution. Change-Id: I5d2ce3681ec6555a8994bb39def907006be8b79f Closes-Bug: #1546023
This commit is contained in:
parent
230d84cacf
commit
5afd0ac1e1
|
@ -52,7 +52,7 @@ class Manager(object):
|
|||
excludes)
|
||||
|
||||
with open(self.conf.lastdump, "w") as fo:
|
||||
fo.write("{0}.tar.xz".format(self.conf.target))
|
||||
fo.write("{0}.tar.gz".format(self.conf.target))
|
||||
except IOError as e:
|
||||
if e.errno == errno.ENOSPC:
|
||||
logger.error("Not enough space in "
|
||||
|
@ -60,7 +60,7 @@ class Manager(object):
|
|||
self.clear_target()
|
||||
raise
|
||||
|
||||
return "{0}.tar.xz".format(self.conf.target)
|
||||
return "{0}.tar.gz".format(self.conf.target)
|
||||
|
||||
def action_single(self, obj, action='snapshot'):
|
||||
driver = Driver.getDriver(obj, self.conf)
|
||||
|
|
|
@ -58,7 +58,7 @@ class TestUtils(base.BaseTestCase):
|
|||
self.assertEqual(compress_env['XZ_OPT'], level)
|
||||
self.assertEqual(
|
||||
compress_call[0][0],
|
||||
'tar chJvf /path/target.tar.xz -C /path target')
|
||||
'tar chzvf /path/target.tar.gz -C /path target')
|
||||
|
||||
self.assertEqual(rm_call[0][0], 'rm -r /path/target')
|
||||
|
||||
|
@ -77,7 +77,7 @@ class TestUtils(base.BaseTestCase):
|
|||
self.assertEqual(compress_env['XZ_OPT'], level)
|
||||
self.assertEqual(
|
||||
compress_call[0][0],
|
||||
'tar chJvf /path/target.tar.xz -C /path target '
|
||||
'tar chzvf /path/target.tar.gz -C /path target '
|
||||
'--exclude /path/to/exclude1 --exclude /path/to/exclude2')
|
||||
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ def compress(target, level, keep_target=False, exclude=None):
|
|||
|
||||
env = copy.deepcopy(os.environ)
|
||||
env['XZ_OPT'] = level
|
||||
execute("tar chJvf {0}.tar.xz -C {1} {2}{3}"
|
||||
execute("tar chzvf {0}.tar.gz -C {1} {2}{3}"
|
||||
"".format(target,
|
||||
os.path.dirname(target),
|
||||
os.path.basename(target),
|
||||
|
|
Loading…
Reference in New Issue