From 3f36448e1747211d0f56a0817c96b0b7c8bcf96d Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 27 Feb 2019 15:01:46 +0100 Subject: [PATCH] DOC: update management.txt to reflect that threads are used by default It was still mentioned "single-threaded" there. It was also the opportunity to mention that multiple threads are started by default. --- doc/management.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/management.txt b/doc/management.txt index a3f237122f..87368ae5da 100644 --- a/doc/management.txt +++ b/doc/management.txt @@ -48,13 +48,21 @@ familiar with troubleshooting utilities such as strace and tcpdump. 2. Quick reminder about HAProxy's architecture ---------------------------------------------- -HAProxy is a single-threaded, event-driven, non-blocking daemon. This means is +HAProxy is a multi-threaded, event-driven, non-blocking daemon. This means is uses event multiplexing to schedule all of its activities instead of relying on the system to schedule between multiple activities. Most of the time it runs as a single process, so the output of "ps aux" on a system will report only one "haproxy" process, unless a soft reload is in progress and an older process is finishing its job in parallel to the new one. It is thus always easy to trace -its activity using the strace utility. +its activity using the strace utility. In order to scale with the number of +available processors, by default haproxy will start one worker thread per +processor it is allowed to run on. Unless explicitly configured differently, +the incoming traffic is spread over all these threads, all running the same +event loop. A great care is taken to limit inter-thread dependencies to the +strict minimum, so as to try to achieve near-linear scalability. This has some +impacts such as the fact that a given connection is served by a single thread. +Thus in order to use all available processing capacity, it is needed to have at +least as many connections as there are threads, which is almost always granted. HAProxy is designed to isolate itself into a chroot jail during startup, where it cannot perform any file-system access at all. This is also true for the