]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: cfgparse: detect numa and set affinity if needed
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 26 Mar 2021 17:20:47 +0000 (18:20 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 23 Apr 2021 14:06:49 +0000 (16:06 +0200)
commitb56a7c89a80f80c8498fba2b3a94d53ac596409d
treece3580164586997d9c870cb369102a117cbf2ec6
parenta80823543c15ac51dcfa6c442b77172f544ce60c
MEDIUM: cfgparse: detect numa and set affinity if needed

On process startup, the CPU topology of the machine is inspected. If a
multi-socket CPU machine is detected, automatically define the process
affinity on the first node with active cpus. This is done to prevent an
impact on the overall performance of the process in case the topology of
the machine is unknown to the user.

This step is not executed in the following condition :
- a non-null nbthread statement is present
- a restrictive 'cpu-map' statement is present
- the process affinity is already restricted, for example via a taskset
  call

For the record, benchmarks were executed on a machine with 2 CPUs
Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz. In both clear and ssl
scenario, the performance were sub-optimal without the automatic
rebinding on a single node.
include/haproxy/defaults.h
src/cfgparse.c