System

NUMA Architecture and MySQL

numa-architecture NUMA is a new architecture for multiprocessor systems. Each physical processor has its own memory, allowing faster memory access than the older architecture. How does Linux manage a NUMA system?

  1. It views hardware at the physical layer.
  2. It calls each processor a node: one node is one physical processor.
  3. It allocates each memory module to a processor.
  4. It provides communication cost information between nodes.

Command to check how much memory Linux uses on each processor:

# numactl --hardware
available: 2 nodes (0-1)
node 0 size: 32276 MB
node 0 free: 26856 MB
node 1 size: 32320 MB
node 1 free: 26897 MB
node distances:
node 0 1
0: 10 21
1: 21 10

The output above has three parts:

  1. The number of nodes in the system.
  2. The memory assigned to each node and the free memory on each node.
  3. Distance is the cost of accessing memory on each node.

Numa setting for MySQL Using NUMA with MySQL can improve MySQL performance and prevent uneven memory allocation across CPUs. One symptom is increasing swap use even though memory remains available. To configure MySQL to use a NUMA policy for memory management, use numactl. Edit mysqld_safe below:

cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS"

Append the following after the section above:

cmd="/usr/bin/numactl --interleave all $cmd"
EOF.← Back to articles