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

I purchased two new cpus E5-2650:

8c * 16t per core = 128 * 2 = 256 - max number of threads

but it looks like ffmpeg doesn't use maximum power of cpu even though i'm running it with -threads 0. from atop i can see that ffmpeg uses only 72 threads.

  PID     RUID         EUID          THR      SYSCPU      USRCPU      VGROW      RGROW      RDDSK      WRDSK     ST     EXC     S     CPUNR      CPU     CMD         1/9
40919     root         root           72       1.37s      20.09s         0K         0K      2688K       768K     --       -     S         7     1084%     ffmpeg


vendor_id   : GenuineIntel
cpu family  : 6
model       : 45
model name  : Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz
stepping    : 7
microcode   : 0x70a
cpu MHz     : 2001.000
cache size  : 20480 KB
physical id : 1
siblings    : 16
core id     : 7
cpu cores   : 8
apicid      : 47
initial apicid  : 47
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid
bogomips    : 3990.40
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:
share|improve this question
If something else was the limiting factor, such as disk io, wouldn't that prevent more threads running? – Chris Feb 27 '13 at 20:36
threads 0 is "optimal" threads - why are you expecting more than it can use optimally? You'd want to read the source regarding how it makes the decision to start a new thread to work it out. Perhaps the process cannot be parallelised further. – Paul Feb 27 '13 at 21:05
up vote 1 down vote accepted

The E5-2650 has 8 cores and can process 2 treads per code. That is 16 treads per CPU. Not 16 per core.

Two CPUs have a total or 32 treads. Assuming the rest of the computer is fast enough to keep feeding the CPU then the optimal use would be near 32 treads. In praxis this is not true, there is always some other delay, either when reading from memory, when reading or writing to disk or from somewhere else. So optimal usage is not always the same as max number is usable treads.

In your case 72 threads are probably used because some got started, then had to wait on other data. Meanwhile other treads can continue. So there are actually more treads active than can be computed on at the same time.

share|improve this answer

You must log in to answer this question.

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