haproxy/reg-tests
Willy Tarreau e049bd00ab MEDIUM: config: change default limits to 1024 threads and 32 groups
A test run on a dual-socket EPYC 9845 (2x160 cores) showed that we'll
be facing new limits during the lifetime of 3.2 with our current 16
groups and 256 threads max:

  $ cat test.cfg
  global
      cpu-policy perforamnce

  $ ./haproxy -dc -c -f test.cfg
  ...
  Thread CPU Bindings:
    Tgrp/Thr  Tid        CPU set
    1/1-32    1-32       32: 0-15,320-335
    2/1-32    33-64      32: 16-31,336-351
    3/1-32    65-96      32: 32-47,352-367
    4/1-32    97-128     32: 48-63,368-383
    5/1-32    129-160    32: 64-79,384-399
    6/1-32    161-192    32: 80-95,400-415
    7/1-32    193-224    32: 96-111,416-431
    8/1-32    225-256    32: 112-127,432-447

Raising the default limit to 1024 threads and 32 groups is sufficient
to buy us enough margin for a long time (hopefully, please don't laugh,
you, reader from the future):

  $ ./haproxy -dc -c -f test.cfg
  ...
  Thread CPU Bindings:
    Tgrp/Thr  Tid        CPU set
    1/1-32    1-32       32: 0-15,320-335
    2/1-32    33-64      32: 16-31,336-351
    3/1-32    65-96      32: 32-47,352-367
    4/1-32    97-128     32: 48-63,368-383
    5/1-32    129-160    32: 64-79,384-399
    6/1-32    161-192    32: 80-95,400-415
    7/1-32    193-224    32: 96-111,416-431
    8/1-32    225-256    32: 112-127,432-447
    9/1-32    257-288    32: 128-143,448-463
    10/1-32   289-320    32: 144-159,464-479
    11/1-32   321-352    32: 160-175,480-495
    12/1-32   353-384    32: 176-191,496-511
    13/1-32   385-416    32: 192-207,512-527
    14/1-32   417-448    32: 208-223,528-543
    15/1-32   449-480    32: 224-239,544-559
    16/1-32   481-512    32: 240-255,560-575
    17/1-32   513-544    32: 256-271,576-591
    18/1-32   545-576    32: 272-287,592-607
    19/1-32   577-608    32: 288-303,608-623
    20/1-32   609-640    32: 304-319,624-639

We can change this default now because it has no functional effect
without any configured cpu-policy, so this will only be an opt-in
and it's better to do it now than to have an effect during the
maintenance phase. A tiny effect is a doubling of the number of
pool buckets and stick-table shards internally, which means that
aside slightly reducing contention in these areas, a dump of tables
can enumerate keys in a different order (hence the adjustment in the
vtc).

The only really visible effect is a slightly higher static memory
consumption (29->35 MB on a small config), but that difference
remains even with 50k servers so that's pretty much acceptable.

Thanks to Erwan Velu for the quick tests and the insights!
2025-05-13 18:15:33 +02:00
..
balance REGTESTS: disable the test balance/balance-hash-maxqueue 2025-03-25 18:24:49 +01:00
cache REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
checks REGTEST: add new reg-test for the 4 new clienthello fetches 2025-04-17 16:39:47 +02:00
compression CLEANUP: assorted typo fixes in the code and comments 2025-04-02 11:12:20 +02:00
connection REGTESTS: extend conn reuse test with transparent proxy 2025-04-02 14:57:40 +02:00
contrib REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
converter REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
filters REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
http-capture REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
http-cookies REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
http-errorfiles REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
http-messaging Revert "REGTESTS: stop using truncated.vtc on freebsd" 2025-02-18 17:35:00 +01:00
http-rules MEDIUM: config: change default limits to 1024 threads and 32 groups 2025-05-13 18:15:33 +02:00
http-set-timeout REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
jwt REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
log REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
lua MINOR: hlua: rename "tune.lua.preserve-smp-bool" to "tune.lua.bool-sample-conversion" 2024-12-20 17:34:05 +01:00
mailers MINOR: hlua: rename "tune.lua.preserve-smp-bool" to "tune.lua.bool-sample-conversion" 2024-12-20 17:34:05 +01:00
mcli REGTESTS: disable temporarly mworker test on OSX 2024-11-20 17:13:59 +01:00
peers REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
pki REGTESTS: pki: add a pki for SSL tests 2023-10-09 21:54:31 +02:00
sample_fetches REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
seamless-reload REGTESTS: switch to -Ws for master-worker reg-tests 2024-11-20 17:13:59 +01:00
server REGTESTS: fix reg-tests/server/abnsz.vtc 2025-02-21 08:22:25 +01:00
spoe REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
ssl REGTESTS: ssl: add a PEM with mix of LF and CRLF line endings 2024-12-13 18:13:42 +01:00
startup REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
stats REGTESTS: add missing timeouts to 30 tests 2024-11-19 08:46:02 +01:00
stick-table REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
stickiness REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
stream REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
tcp-rules REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
webstats REGTESTS: use -dW by default on every reg-tests 2024-11-19 16:53:10 +01:00
README REGTESTS: extend the default I/O timeouts and make them overridable 2021-11-18 17:57:11 +01:00

                 * Regression testing for HAProxy with VTest *


This little README file is about how to compile and run vtest test case files (VTC files)
to test HAProxy for any regression.

To do so, you will have to compile vtest program sources which depends on
Varnish cache application sources. vtest, formerly varnishtest, is a very useful
program which has been developed to test Varnish cache application. vtest has been
modified in collaboration with Varnish cache conceptor Poul-Henning Kamp to support
HAProxy in addition to Varnish cache.

See also: doc/regression-testing.txt

* vtest compilation *

    $ git clone https://github.com/vtest/VTest

    $ cd VTest

    $ make vtest

  Then vtest program may be found at the root directory of vtest sources directory.
  The Varnish cache manuals are located in 'man' directory of Varnish cache sources
  directory. You will have to have a look at varnishtest(7) and vtc(7) manuals to
  use vtest.

  Some information may also be found in doc/regression-testing.txt in HAProxy
  sources.

  Note that VTC files for Varnish cache may be found in bin/varnishtest/tests directory
  of Varnish cache sources directory which may be found here:
  https://github.com/varnishcache/varnish-cache


* vtest execution *

  You must set HAPROXY_PROGRAM environment variable to give the location
  of the HAProxy program to test to vtest:

    $ HAPROXY_PROGRAM=<my haproxy program> vtest ...

  The HAProxy VTC files found in HAProxy sources may be run with the reg-tests
  Makefile target. You must set the VTEST_PROGRAM environment variable to
  give the location of the vtest program which has been previously compiled.

    $ VTEST_PROGRAM=<my vtest program> make reg-tests

  "reg-tests" Makefile target run scripts/run-regtest.sh script.
  To get more information about this script run it with --help option.

  Note that vtest is run with -t10 and -l option. -l option is to keep
  keep vtest temporary directory in case of failed test cases. core files
  may be found in this directory (if enabled by ulimit).


* vtest patches for HAProxy VTC files *

  When producing a patch to add a VTC regression testing file to reg-tests directory,
  please follow these simple rules:

    - If your VTC file needs others files, if possible, use the same basename as that
      of the VTC file,
    - Put these files in a directory with the same name as the code area concerned
      by the bug ('peers', 'lua', 'acl' etc).

Please note that most tests use a common set of timeouts defined by the
environment variable HAPROXY_TEST_TIMEOUT. As much as possible, for regular I/O
(i.e. not errors), please try to reuse that setting so that the value may
easily be adjusted when running in some particularly slow environments, or be
shortened to fail faster on developers' machines.