pxz icon indicating copy to clipboard operation
pxz copied to clipboard

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

Open marcominetti opened this issue 10 years ago • 4 comments

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 avatar Dec 15 '14 11:12 marcominetti

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

jurov avatar Aug 18 '15 14:08 jurov

Thanks

marcominetti avatar Aug 20 '15 18:08 marcominetti

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.

JoSys avatar Feb 17 '16 20:02 JoSys

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

mvrk69 avatar Feb 07 '18 11:02 mvrk69