Re: stats http counter issue

2019-11-06 Thread Willy Tarreau
On Wed, Nov 06, 2019 at 11:03:47AM +0100, Jean Wasilewski wrote:
> Removing nbproc and nbthread did resolve the issue.

Ah I like to read this! When less settings work better, it's
always pleasant and confirms that all this dev was time well
invested!

Cheers,
Wlily



Re: stats http counter issue

2019-11-06 Thread Jean Wasilewski
Hi Willy,

On 11-06 07:56 am (Wed), Willy Tarreau wrote:
> Hi Jean,
> 
> On Tue, Nov 05, 2019 at 04:33:00PM +0100, Jean Wasilewski wrote:
> > Hi,
> > 
> > While using the stats socket with the official HAProxy exporter, I
> > noticed that some metrics seem erronous. While querying for a specific
> > frontend, the admin socket reported two differents metrics for the same
> > frontend.
> > 
> > I made this small onliner two retrieve values (with here an example on
> > 2XX calls on our frontend `console-online`):
> > 
> > ```
> > $ while true; do echo "show stat" | socat - /run/haproxy/admin.sock |grep \
> > -E '\#|FRONT' |grep -E '\#|console' |cut -d, -f41 |xargs -L2 echo; sleep \
> > 1; done
> > hrsp_2xx 2141807
> > hrsp_2xx 136536
> > hrsp_2xx 2141819
> > hrsp_2xx 2141828
> > hrsp_2xx 136536
> > hrsp_2xx 2141841
> > hrsp_2xx 2141846
> > hrsp_2xx 136537
> > hrsp_2xx 2141854
> > hrsp_2xx 2141856
> > hrsp_2xx 2141863
> > hrsp_2xx 136537
> > ```
> > 
> > Is this a bug or a misconfiguration?
> 
> It sounds like you're working in multi-process mode (nbproc > 1). If
Indeed, nproc was set to 2.
> so, this is the expected behavior since stats are per process. This
> was one of the drivers for the porting to threads. If for any reason
> you really want to stick to nbproc, then I'd recommend you to use one
> stats socket per process (use the "process" directive on each line)
> and to query both of them individually. But frankly this is painful as
> it may return conflicting server states during some transitions because
> the checks are per-process as well.
> 
> You can replace "nbproc 2" with "nbthread 2" in your config, watch for
> warnings in case you'd already have a few explicit "process" entries,
> or even remove nbproc and nbthread to let haproxy start one thread per
> available core.
Removing nbproc and nbthread did resolve the issue.
> 
> Hoping this helps,
> Willy

Thank you very much!

Jean


signature.asc
Description: PGP signature


Re: stats http counter issue

2019-11-05 Thread Willy Tarreau
Hi Jean,

On Tue, Nov 05, 2019 at 04:33:00PM +0100, Jean Wasilewski wrote:
> Hi,
> 
> While using the stats socket with the official HAProxy exporter, I
> noticed that some metrics seem erronous. While querying for a specific
> frontend, the admin socket reported two differents metrics for the same
> frontend.
> 
> I made this small onliner two retrieve values (with here an example on
> 2XX calls on our frontend `console-online`):
> 
> ```
> $ while true; do echo "show stat" | socat - /run/haproxy/admin.sock |grep \
> -E '\#|FRONT' |grep -E '\#|console' |cut -d, -f41 |xargs -L2 echo; sleep \
> 1; done
> hrsp_2xx 2141807
> hrsp_2xx 136536
> hrsp_2xx 2141819
> hrsp_2xx 2141828
> hrsp_2xx 136536
> hrsp_2xx 2141841
> hrsp_2xx 2141846
> hrsp_2xx 136537
> hrsp_2xx 2141854
> hrsp_2xx 2141856
> hrsp_2xx 2141863
> hrsp_2xx 136537
> ```
> 
> Is this a bug or a misconfiguration?

It sounds like you're working in multi-process mode (nbproc > 1). If
so, this is the expected behavior since stats are per process. This
was one of the drivers for the porting to threads. If for any reason
you really want to stick to nbproc, then I'd recommend you to use one
stats socket per process (use the "process" directive on each line)
and to query both of them individually. But frankly this is painful as
it may return conflicting server states during some transitions because
the checks are per-process as well.

You can replace "nbproc 2" with "nbthread 2" in your config, watch for
warnings in case you'd already have a few explicit "process" entries,
or even remove nbproc and nbthread to let haproxy start one thread per
available core.

Hoping this helps,
Willy



stats http counter issue

2019-11-05 Thread Jean Wasilewski
Hi,

While using the stats socket with the official HAProxy exporter, I
noticed that some metrics seem erronous. While querying for a specific
frontend, the admin socket reported two differents metrics for the same
frontend.

I made this small onliner two retrieve values (with here an example on
2XX calls on our frontend `console-online`):

```
$ while true; do echo "show stat" | socat - /run/haproxy/admin.sock |grep \
-E '\#|FRONT' |grep -E '\#|console' |cut -d, -f41 |xargs -L2 echo; sleep \
1; done
hrsp_2xx 2141807
hrsp_2xx 136536
hrsp_2xx 2141819
hrsp_2xx 2141828
hrsp_2xx 136536
hrsp_2xx 2141841
hrsp_2xx 2141846
hrsp_2xx 136537
hrsp_2xx 2141854
hrsp_2xx 2141856
hrsp_2xx 2141863
hrsp_2xx 136537
```

Is this a bug or a misconfiguration?

I am running the latest stable version of HAProxy (2.0.8-1ppa1~xenial).

Thank you in advance,

Jean Wasilewski


signature.asc
Description: PGP signature