I'm asking about a scenario of copying a big file to a remote server.
A simplest case is:
tar c myfile | ssh myserver tar x
If network connectivity is fast then all is fine.
On a slower network I do
tar c myfile | bzip2 -1 | ssh myserver tar xj
-- making my transfer faster at the cost of CPU time.
Of course I can play with compression ratio, typically trying to guess the right one so my CPU is not too busy and the network is saturated.
Is there a compression utility or a compression flag that would tell
xz/... to compress as much as possible while the output buffer is busy?