Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

According to xz documentation the "-T 4" means I should be using 4 threads, each compressing a different part of the file simultaneously.

Before using nice -19 I would only get %50 usage of 1 core, Now how do I use the other 3 cores?(these aren't virtual cores either, they're real)

nice -19 xz -v9ekC sha256 -T 4 /path/to/file.tar

only 1 processor over %50 at time!!

share|improve this question
    
Which version of xz are you using? – jjlin Sep 28 '13 at 22:20
1  
How fast is your IO? If you can not read fast enough from disk (or disk cache) then throwing more cores at it will not help. Are you testing with a huge file ? – Hennes Sep 28 '13 at 22:21
    
@jjlin 5.1.0alpha – GlassGhost Sep 30 '13 at 20:41
    
@Hennes xz compression is very much CPU-bound, unless you have a pretty unusual hardware configuration. – jjlin Sep 30 '13 at 21:16

Multithreaded coding wasn't implemented until 5.1.1alpha:

http://git.tukaani.org/?p=xz.git;a=blob;f=NEWS;hb=HEAD

This is easy to verify if you compare src/xz/coder.c for the 5.1.0alpha and 5.1.1alpha (just search for "thread").

share|improve this answer
    
Before I mark this as accepted, I'd like to test it 1st. I guess I'll have to wait til 5.1.1alpha or higher is released for ubuntu; I've been looking for an excuse to install funtoo linux. – GlassGhost Oct 25 '13 at 17:38
    
It's actually pretty straightforward to just download the source and compile it yourself. I don't recall xz having any uncommon external dependencies. – jjlin Oct 25 '13 at 17:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .