Stot graph wrong behavior


#1

Hi,

I have some graphs haproxy values ​​and the stot is one of them. This value in the haproxy guide (https://cbonte.github.io/haproxy-dconv/1.6/management.html) is:

  1. stot [LFBS]: cumulative number of connections

When it plots this value shows something like this:

Values in average increase but produces decreases sometimes in this value.

I see the same behavior when I try to collect, each second, this value directly from socket:

echo ‘show info;show stat;show table’ | socat stdio unix-connect:/run/haproxy.sock …
[…]
11998
10606
10607
11998
2270
10609
11998
10609
2271
11998
11999
11999
2271
2271
11999
10612
2271
10612
[…]

I don’t understand this behavior, may be haproxy configuration? I think that the normal behavior should be only increase with time, isn’t?

if it necessary i can send the configuration or any information that would be required to understand this behavior.

Thanks!


#2

Do you use nbproc? Do you have dedicated stat socket per process? Otherwise you will just hit the stats socket of a random process leading to this behavior.

Please share your configuration.


#3

Hi lukastribus,

Thanks for your reply, I studied nbproc value and it’s true, we config haproxy to run 3 processes, and the haproxy’s stats values:

stats bind-process 3
stats socket /var/run/haproxy.sock mode 666 level admin

This, I think it should to pin the stats socket with the 3 processes, because of this may be the graph shows these behavior.

The documentation says:

stats bind-process [ all | odd | even | <number 1-64>[-<number 1-64>] ] …
Limits the stats socket to a certain set of processes numbers. By default the
stats socket is bound to all processes, causing a warning to be emitted when
nbproc is greater than 1 because there is no way to select the target process
when connecting. However, by using this setting, it becomes possible to pin
the stats socket to a specific set of processes, typically the first one. The
warning will automatically be disabled when this setting is used, whatever
the number of processes used. The maximum process ID depends on the machine’s
word size (32 or 64). A better option consists in using the “process” setting
of the “stats socket” line to force the process on each line.

You know how to setting of the stats socket using the process to force the process on each line? Or another solution to split the values of these 3 processes.

Thanks!


#4

What you quoted above:

A better option consists in using the “process” setting
of the “stats socket” line to force the process on each line.

As in:

stats socket /var/run/haproxy1.sock mode 666 level admin haproxy process 1
stats socket /var/run/haproxy2.sock mode 666 level admin haproxy process 2
stats socket /var/run/haproxy3.sock mode 666 level admin haproxy process 3
stats socket /var/run/haproxy4.sock mode 666 level admin haproxy process 4