]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: init: pre-allocate kernel data structures on init
authorPatrick Hemmer <patrick.hemmer@gmail.com>
Tue, 23 May 2023 17:02:08 +0000 (13:02 -0400)
committerWilly Tarreau <w@1wt.eu>
Fri, 26 May 2023 07:28:18 +0000 (09:28 +0200)
commit425d7ad89daa223ab00479119c8b6c41ba033314
tree4c73a93016526ca41cb0272ef841be00c0fc0336
parent6626195ff25d71b0694b0bf710153ca077883391
MINOR: init: pre-allocate kernel data structures on init

The Linux kernel maintains data structures to track a processes' open file
descriptors, and it expands these structures as necessary when FD usage grows
(at every FD=2^X starting at 64). However when threading is in use, during
expansion the kernel will pause (observed up to 47ms) while it waits for thread
synchronization (see https://bugzilla.kernel.org/show_bug.cgi?id=217366).

This change addresses the issue and avoids the random pauses by opening the
maximum file descriptor during initialization, so that expansion will not occur
while processing traffic.
doc/configuration.txt
include/haproxy/global-t.h
src/cfgparse-global.c
src/haproxy.c