Monday, June 15, 2015

NUMA and JVM performance

Apparently there is a 40% performance gain to be made configuring the JVM to take advantage of the NUMA architecture. Just pass the -XX:+UseNUMA flag to your JVM.

To check if your hardware is NUMA enabled, run numactl:

numactl --hardware

For instance I get

available: 1 nodes (0)
node 0 size: 15897 MB
node 0 free: 344 MB
node distances:
node   0 
  0:  10 



which probably means I have no NUMA since I have a single node. You can also run numastat.

It's interesting also to run taskset:

taskset -c -p 5794

pid 5794's current affinity list: 0-3

to determine to which CPUs a given process is associated. Apparently this is quite important for memory allocation/deallocation performance - I still don't understand how :o(

See also this http://www.glennklockwood.com/comp/affinity.php



No comments: