Skip to content

Instantly share code, notes, and snippets.

@frobware
Last active May 7, 2024 17:26
Show Gist options
  • Save frobware/2b527ce3f040797909eff482a4776e0b to your computer and use it in GitHub Desktop.
Save frobware/2b527ce3f040797909eff482a4776e0b to your computer and use it in GitHub Desktop.
NE1690: Analyse Memory Impact of Pre-Allocated Server Slots for Different Numbers of Routes

HAProxy version 2.8.5-aaba8d0 2023/12/07 - https://haproxy.org/

Algorithm=leastconn, Weight=1 maxconn=50000 (T=#Threads B=#Backends)

server-template range: 0..N  T4 B100 RSS (MB)  T4 B1000 RSS (MB)  T4 B10000 RSS (MB)  T64 B100 RSS (MB)  T64 B1000 RSS (MB)  T64 B10000 RSS (MB)
---------------------------  ----------------  -----------------  ------------------  -----------------  ------------------  -------------------
                          0                12                 18                  81                 17                  24                   86
                          1                12                 22                 123                 18                  32                  168
                          2                13                 27                 166                 19                  40                  249
                          5                14                 39                 292                 21                  64                  492
                         10                16                 60                 504                 25                 105                  898
                        100                54                441                4308                 98                 835                 8204
                        200                96                863                8534                180                1647                16322
                        300               139               1286               12761                261                2459                24440

Algorithm=random, Weight=1 maxconn=50000 (T=#Threads B=#Backends)

server-template range: 0..N  T4 B100 RSS (MB)  T4 B1000 RSS (MB)  T4 B10000 RSS (MB)  T64 B100 RSS (MB)  T64 B1000 RSS (MB)  T64 B10000 RSS (MB)
---------------------------  ----------------  -----------------  ------------------  -----------------  ------------------  -------------------
                          0                12                 18                  81                 17                  23                   86
                          1                12                 23                 131                 18                  32                  175
                          2                13                 28                 181                 19                  41                  264
                          5                14                 43                 330                 22                  68                  530
                         10                17                 68                 579                 26                 112                  973
                        100                62                515                5055                106                 910                 8952
                        200               111               1013               10030                194                1797                17817
                        300               161               1510               15004                283                2683                26683

Algorithm=roundrobin, Weight=1 maxconn=50000 (T=#Threads B=#Backends)

server-template range: 0..N  T4 B100 RSS (MB)  T4 B1000 RSS (MB)  T4 B10000 RSS (MB)  T64 B100 RSS (MB)  T64 B1000 RSS (MB)  T64 B10000 RSS (MB)
---------------------------  ----------------  -----------------  ------------------  -----------------  ------------------  -------------------
                          0                12                 18                  80                 17                  24                   86
                          1                12                 22                 123                 18                  32                  168
                          2                13                 26                 166                 19                  40                  249
                          5                14                 39                 293                 21                  64                  492
                         10                16                 60                 504                 25                 105                  898
                        100                54                441                4308                 98                 835                 8204
                        200                96                863                8534                180                1647                16322
                        300               139               1286               12761                261                2459                24440
@frobware
Copy link
Author

frobware commented May 7, 2024

In later revisions I've also noted in the table header that this is when maxconn=50,000.

@frobware
Copy link
Author

frobware commented May 7, 2024

Revision 4 is using haproxy-2.8.5.

@frobware
Copy link
Author

frobware commented May 7, 2024

Revision 5 updates the column header to server-template range: 0..N, hopefully clarifying the representation of these numbers. My tooling currently lacks the capability to switch from specifying server-template to emitting a list of individual server lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment