Haproxy uses a lot of memory with many backend servers

I really appreciate your advices because I’m wandering at Google for clarifying how to check the effect of the number of servers at backend. Thank you so much.
I summarize your advices.

  • Rather than the number of servers, the concurrent connections(Memory Usage) and the traffic rate, the the number of TLS handshakes per second(CPU Usage) will consume the most of computing resources, CPU and RAM.
  • Servers do not waste a buffer anymore when the checks are not running.
  • And NIC and HAProxy should run on the same CPU.

Could I ask some questions more?

  • As I’m a newbie at sw and network area, I don’t know what to do for estimating the consumed resources (such as 2.7kB memory per server, 17 and 35 kB memory per active client connection). How can I estimate these things by myself? For example, for estimating the effect of number of servers at backend at HAProxy, we can’t buy larger number number of servers` just for testing. I try to estimate it by reading the HAProxy source code but it seems not to help.
  • You said data rate and TLS handshake burden CPU. Is it from establishing connections towards backend and forwarding data and connection?
  • To make NIC and HAProxy run on the same CPU, do I need to set some config at haproxy.cfg or some linux kernel config? (I check your other post, Architectural limitation for nbproc? - #6 by willy. It said numactl)

I’m sorry if these questions are too basic and Thank you for your time.