I have two servers at hand, both with 16 cores. The first is running Debian, the second running Ubuntu.

I have written a small multithreaded java app that creates 16 threads. On the Debian machine, the program uses at most 8 cores, while on the Ubuntu machine the program uses all 16 cores.

Since my program and the hardware are identical, the used cores must somehow be limited by Linux itself. What is the cause for this limit? How can I increase this limit?

/proc/cpuinfo (i = 0 to 15):

processor   : i
vendor_id   : GenuineIntel
cpu family  : 6
model       : 44
model name  : Intel(R) Xeon(R) CPU           E5630  @ 2.53GHz
stepping    : 2
cpu MHz     : 2533.390
cache size  : 12288 KB
physical id : 1
siblings    : 8
core id     : 10
cpu cores   : 4
apicid      : 53
initial apicid  : 53
fpu     : yes
fpu_exception   : yes
cpuid level : 11
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 dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips    : 5066.86
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

java -version:

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

uname -a:

Linux servername 2.6.38-2-amd64 #1 SMP Thu Apr 7 04:28:07 UTC 2011 x86_64 GNU/Linux
  • Are you sure the machine has 16 cores? A feature called Hyperthreading may represent double the amount of cores in the OS. Please post the exact CPU model (cat /proc/cpuinfo). Besides: what JVM and Linux kernels are you running? (java -version and uname -a) – gertvdijk Dec 19 '12 at 11:45
  • 1
    Your Xeon processor model E5630 is a Quad-core with Hyperthreading. Do you have two of these installed? Unless you have four of them in one system, you don't have 16 cores. – gertvdijk Dec 19 '12 at 11:58
  • 1
    I have 16 cores (4 cpus with hyperthreading). Interestingly, running 'sysbench --test=cpu --num-threads=16 --cpu-max-prime=10000000000 run' increases the total load to 1600%. So, i think it might be a jvm issue. Remember, the same java code runs at another machine at 16 cores, but on the above mentioned only at 8 cores. – Julian Dec 19 '12 at 12:02
  • 1
    By the way: processor : 0 to 15. You should have 32 here. 16 cores should represent 32 cores in OS using Hyperthreading. Are you sure all four of your CPUs are installed and detected? Or do you have Hyperthreading enabled on one machine but disabled on the other? – gertvdijk Dec 19 '12 at 12:13
  • 1
    Solved. A simple reboot did the trick. Machine was running for 441 days. – Julian Dec 19 '12 at 13:30