Stats and multiprocessing + multithreading in same time


#1

Hello

Im using Haproxy with both nbproc and nbthread.
this is my configuration :

nbproc 6
nbthread 8
cpu-map auto:1/1-8 0-7
cpu-map auto:2/1-8 8-15
cpu-map auto:3/1-8 16-23
cpu-map auto:4/1-8 24-31
cpu-map auto:5/1-8 32-39
cpu-map auto:6/1-8 40-47

this command confirms I have 48 threads with 1 master
ps -efL | grep haproxy | grep -v exporter | grep -v grep | wc -l

the problem is statistics, I don’t have a valid statistics with the following configuration :

listen stats-Static
 bind *:4444
 stats uri /Static-stats
 bind-process 5
 stats enable
 stats scope front-http
 stats scope Static
 stats hide-version
 stats show-legends

I even trying this on stats but its not working

 bind-process 5/1-8
 bind-process 5/32-39

How can I get every threads in process statistics ?
and another question is healthcheck is per thread or per process ?

thank you


#2

Why would you do that? That makes your setup unnecessarily complex.

Stats are per-process, not per-thread. You bind stats to a process, not to a thread, and you see everything from that process.

Per-process.


#3

to gain maximum performance .

the problem is exactly here when i use this mapping everything would fine :
cpu-map auto:1/all 0
cpu-map auto:2/all 1
cpu-map auto:3/all 2
cpu-map auto:4/all 3
cpu-map auto:5/all 4
cpu-map auto:6/all 5

I have 60000 sess/s on my application, one frontend 8 backends with 28 servers. Im using 5 servers for Haproxy (2x E5-2650 and 256gb ram ) and its important for me the gain maximum performance.

that’s good because with that number of servers health check is a bit challenging for me it takes 20% CPU usage on my worker server and I need to figure this out.

what do you suggest?


#4

hi @arash , how are you?

after set “nbproc” and “cpu-map” on global section,do you config “stats socket” per process on global section and config “bind-process” on your “frontend” section?