Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slower than tar #2

Open
jonatanblue opened this issue Jun 15, 2017 · 1 comment
Open

Slower than tar #2

jonatanblue opened this issue Jun 15, 2017 · 1 comment

Comments

@jonatanblue
Copy link
Owner

jonatanblue commented Jun 15, 2017

It takes around two times longer to backup a directory compared to using tar on the command line.

dinghy:

# time ./dinghy.py --dirs=/var/lib/rundeck/logs backup --dest /tmp/backup-test --filename=test.tar.gz
2017-06-15 09:34:12,679 WARNING overriding default directories with /var/lib/rundeck/logs
2017-06-15 09:34:12,724 INFO counting files...
2017-06-15 09:34:13,987 INFO adding directory /var/lib/rundeck/logs
Processing |################################| 162445/162445

2017-06-15 09:39:01,148 INFO backup complete

real	4m49.105s
user	2m32.640s
sys	0m38.250s

tar:

# time tar czvf /tmp/backup-test/manual_logs.tar.gz /var/lib/rundeck/logs
...
real	2m22.006s
user	1m1.840s
sys	0m28.210s
@nvtkaszpir
Copy link

nvtkaszpir commented Aug 2, 2017

Try opening file as stream (it has its limitations, though), so try to change 'w:gz' to 'w|gz'.

https://docs.python.org/2/library/tarfile.html#tarfile.open

Or alternativey spawn system process.

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

No branches or pull requests

2 participants