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

Pipe to pxz? Can the parallel algorithm support stdin without eating RAM? #19

Open
marcominetti opened this issue Dec 15, 2014 · 4 comments

Comments

@marcominetti
Copy link

I'd like to do something like:

dd if=/dev/sda bs=1M | pxz -kvc -9 -T8 > out.lzma

I've tried and work but eats lots of ram. Is there any optimization that could be implemented?

@marcominetti marcominetti changed the title Pipe to pxz? Can the parallel algorithm support stdin? Pipe to pxz? Can the parallel algorithm support stdin without eating RAM? Dec 15, 2014
@jurov
Copy link

jurov commented Aug 18, 2015

XZ -9 just needs 674 MiB per thread, that's hardly avoidable. Use lower compression level.

@marcominetti
Copy link
Author

Thanks

@JoSys
Copy link

JoSys commented Feb 17, 2016

You may want to buffer both input and output like so:
dd if=/dev/sda conv=sync,noerror bs=16M | pxz -kvc -9 -T8 | dd of=out.xz bs=16M
With a SSD you might want to use a bigger buffer. Anyway, just use pv command in-between pipes to check out if performance improves.

@mvrk69
Copy link

mvrk69 commented Feb 7, 2018

With pv would be like this?

dd if=/dev/sda conv=sync,noerror bs=16M | pv -s <size_of_sda> | pxz -kvc -9 -T8 | dd of=out.xz bs=16M

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

No branches or pull requests

4 participants