Hi Willy,

Op 1-10-2018 om 4:00 schreef Willy Tarreau:
On Sun, Sep 30, 2018 at 10:16:55PM +0200, PiBa-NL wrote:
Hi Willy,
Op 30-9-2018 om 20:38 schreef Willy Tarreau:
On Sun, Sep 30, 2018 at 08:22:23PM +0200, Willy Tarreau wrote:
On Sun, Sep 30, 2018 at 07:59:34PM +0200, PiBa-NL wrote:
Indeed it works with 1.8, so in that regard i 'think' the test itself is
correct.. Also when disabling threads, or running only 1 client, it still
works.. Then both CumConns CumReq show 11 for the first stats result.
Hmmm for me it fails even without threads. That was the first thing I
tried when meeting the error in fact. But I need to dig deeper.
So I'm seeing that in fact the count is correct if the server connection
closes first, and wrong otherwise. In fact it fails similarly both for
1.6, 1.7, 1.8 and 1.9 with and without threads. I'm seeing that the
connection count is exactly 10 times the incoming connections while the
request count is exactly 20 times this count. I suspect that what happens
is that the request count is increased on each connection when preparing
to receive a new request. This even slightly reminds me something but
I don't know where I noticed something like this, I think I saw this
when reviewing the changes needed to be made to HTTP for the native
internal representation.

So I think it's a minor bug, but not a regression.

Thanks,
Willy
Not sure, only difference between 100x FAILED and 100x OK is the version
here. Command executed and result below.

Perhaps that's just because of the OS / Scheduler used though, i assume your
using some linux distro to test with, perhaps that explains part of the
differences between your and my results..
I find this strange. Your config contains a comment about the length
converter missing from 1.8 so I had to change it to use the deny part
on 1.8. It happens that using deny here precisely is what fixed the
problem for me the first time. I simplified it this way to run a
manual test :

   global
     stats socket /tmp/sock1 mode 666 level admin
     #nbthread 3
     log 127.0.0.1:5514 local0
     #nokqueue

   defaults
     mode http
     option dontlog-normal
     log global
     option httplog
     timeout connect         3s
     timeout client          4s
     timeout server          15s

   frontend fe1
     bind 127.0.0.1:8001
     acl donelooping hdr(TEST) -m len 10
     http-request set-header TEST "%[hdr(TEST)]x"
     use_backend b2 if donelooping
     default_backend b1

   backend b1
     server srv1 127.0.0.1:8001

   frontend fe2
     bind 127.0.0.1:8002
     default_backend b2

   backend b2
     server srv2 127.0.0.1:8000

Then I test it this way and got the same results on all versions :

   $ echo -e "GET / HTTP/1.1\r\n\r\n"|nc 0 8001
   $ echo show info | socat - /tmp/sock1 | grep Cum
   CumConns: 11
   CumReq: 21
   CumSslConns: 0

   $ echo -e "GET / HTTP/1.1\r\nconnection: close\r\n\r\n"|nc 0 8001
   $ echo show info | socat - /tmp/sock1 | grep Cum
   CumConns: 11
   CumReq: 11
   CumSslConns: 0

Regards,
Willy

I have used the exact config above, and well it 'works fine' ?? Results below.. both types of nc requests send to 1 running haproxy result in a proper '21'..

But even in this case the results would be 'predicable', while with my original test the outcome is 'randomized'.. So despite the fact that i don't know whats really wrong, and the environment it runs on does seem to affect things. There is more going on that simply a counter incremented twice.. Also your results are 'higher' than expected, while mine are 'lower' than expected.. Perhaps this single testcase is already showing multiple issues beneath the carpet ;) ?.

Regards,
PiBa-NL (Pieter)

# haproxy -v
HA-Proxy version 1.8.14-52e4d43 2018/09/20
Copyright 2000-2018 Willy Tarreau <[email protected]>

# echo -e "GET / HTTP/1.1\r\n\r\n"|nc 0 8001
HTTP/1.0 503 Service Unavailable
Cache-Control: no-cache
Content-Type: text/html

<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>
# echo -e "GET / HTTP/1.1\r\nconnection: close\r\n\r\n"|nc 0 8001
HTTP/1.0 503 Service Unavailable
Cache-Control: no-cache
Content-Type: text/html

<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>
# echo show info | socat - /tmp/sock1 | grep Cum
CumConns: 21
CumReq: 21
CumSslConns: 0
#
#
# haproxy -v
HA-Proxy version 1.9-dev3-27010f0 2018/09/29
Copyright 2000-2018 Willy Tarreau <[email protected]>

# echo -e "GET / HTTP/1.1\r\n\r\n"|nc 0 8001
HTTP/1.0 503 Service Unavailable
Cache-Control: no-cache
Content-Type: text/html

<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>
# echo -e "GET / HTTP/1.1\r\nconnection: close\r\n\r\n"|nc 0 8001
HTTP/1.0 503 Service Unavailable
Cache-Control: no-cache
Content-Type: text/html

<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>
# echo show info | socat - /tmp/sock1 | grep Cum
CumConns: 21
CumReq: 21
CumSslConns: 0
#


Reply via email to