Hi. Anyone any Idea about the question below?
Regards Alex On Sat, 23 Apr 2022 11:05:36 +0200 Aleksandar Lazic <al-hapr...@none.at> wrote: > Hi. > > I'm not sure if I understand the doc properly. > > https://docs.haproxy.org/2.2/configuration.html#nbthread > ``` > This setting is only available when support for threads was built in. It > makes haproxy run on <number> threads. This is exclusive with "nbproc". While > "nbproc" historically used to be the only way to use multiple processors, it > also involved a number of shortcomings related to the lack of synchronization > between processes (health-checks, peers, stick-tables, stats, ...) which do > not affect threads. As such, any modern configuration is strongly encouraged > to migrate away from "nbproc" to "nbthread". "nbthread" also works when > HAProxy is started in foreground. On some platforms supporting CPU affinity, > when nbproc is not used, the default "nbthread" value is automatically set to > the number of CPUs the process is bound to upon startup. This means that the > thread count can easily be adjusted from the calling process using commands > like "taskset" or "cpuset". Otherwise, this value defaults to 1. The default > value is reported in the output of "haproxy -vv". See also "nbproc". > ``` > > https://docs.haproxy.org/2.2/configuration.html#3.2-maxconn > ``` > Sets the maximum per-process number of concurrent connections to <number>. It > is equivalent to the command-line argument "-n". Proxies will stop accepting > connections when this limit is reached. The "ulimit-n" parameter is > automatically adjusted according to this value. See also "ulimit-n". Note: > the "select" poller cannot reliably use more than 1024 file descriptors on > some platforms. If your platform only supports select and reports "select > FAILED" on startup, you need to reduce maxconn until it works (slightly > below 500 in general). If this value is not set, it will automatically be > calculated based on the current file descriptors limit reported by the > "ulimit -n" command, possibly reduced to a lower value if a memory limit > is enforced, based on the buffer size, memory allocated to compression, SSL > cache size, and use or not of SSL and the associated maxsslconn (which can > also be automatic). > > ``` > > Let's say we have the following setup. > > ``` > maxconn 20000 > nbthread 4 > ``` > > My understanding is that HAProxy will accept 20000 concurrent connection, > right? Even when I increase the nbthread will HAProxy *NOT* accept more then > 20000 concurrent connection, right? > > The increasing of nbthread will "only" change that the performance will be > "better" on a let's say 32 CPU Machine, especially for the upcoming 2.6 :-) > > https://docs.microsoft.com/en-us/azure/virtual-machines/dv3-dsv3-series#dsv3-series > => Standard_D32s_v3: 32 CPU, 128G RAM > > What confuses me is "maximum per-process" in the maxconn docu part, will every > thread handle the maxconn or is this for the whole HAProxy instance. > > More mathematically :-O. > 20000 * 4 = 80000 > or > 20000 * 4 = 20000 > > Regards > Alex >