Hi List, Willy,
I've created a regtest that checks that when concurrent connections are
being handled that the connection counters are kept properly.
I think it could be committed as attached. It takes a few seconds to
run. It currently fails on 1.9-dev2 (also fails on 1.8.13 with kqueue on
FreeBSD, adding a 'nokqueue' on 1.8.13 makes it succeed though..).
I think it might be a good and reproducible test to run.?
Or does it need more tweaking? Thoughts appreciated :).
Regards,
PiBa-NL (Pieter)
From 4b1af997e796e1bb2098c5f66ac24690841c72e8 Mon Sep 17 00:00:00 2001
From: PiBa-NL <piba.nl....@gmail.com>
Date: Sat, 15 Sep 2018 01:51:54 +0200
Subject: [PATCH] REGTEST/MINOR: loadtest: add a test for connection counters
after running 3000 requests in a loop
---
reg-tests/loadtest/b00000-loadtest.vtc | 94 ++++++++++++++++++++++++++
1 file changed, 94 insertions(+)
create mode 100644 reg-tests/loadtest/b00000-loadtest.vtc
diff --git a/reg-tests/loadtest/b00000-loadtest.vtc
b/reg-tests/loadtest/b00000-loadtest.vtc
new file mode 100644
index 00000000..f66df5ee
--- /dev/null
+++ b/reg-tests/loadtest/b00000-loadtest.vtc
@@ -0,0 +1,94 @@
+# Checks that request and connection counters are properly kept
+
+varnishtest "Seamless reload issue with abns sockets"
+feature ignore_unknown_macro
+
+server s1 {
+ rxreq
+ expect req.http.TESTsize == 1000
+ txresp
+} -repeat 3 -start
+
+syslog Slg_1 -level notice {
+ recv
+} -repeat 15 -start
+
+haproxy h1 -W -D -conf {
+ global
+ nbthread 3
+ log ${Slg_1_addr}:${Slg_1_port} local0
+ maxconn 500000
+ #nokqueue
+
+ defaults
+ mode http
+ option dontlog-normal
+ log global
+ option httplog
+ timeout connect 3s
+ timeout client 4s
+ timeout server 15s
+
+ frontend fe1
+ maxconn 20001
+ bind "fd@${fe_1}"
+ acl donelooping hdr(TEST) -m len 1000
+ http-request set-header TEST "%[hdr(TEST)]x"
+ use_backend b2 if donelooping
+ default_backend b1
+
+ backend b1
+ fullconn 20000
+ server srv1 ${h1_fe_1_addr}:${h1_fe_1_port} maxconn 20000
+
+ frontend fe2
+ bind "fd@${fe_2}"
+ default_backend b2
+
+ backend b2
+ # haproxy 1.8 does not have the ,length converter.
+ acl OK hdr(TEST) -m len 1000
+ http-request deny deny_status 200 if OK
+ http-request deny deny_status 400
+
+ # haproxy 1.9 does have a ,length converter.
+ #http-request set-header TESTsize "%[hdr(TEST),length]"
+ #http-request del-header TEST
+ #server srv2 ${s1_addr}:${s1_port}
+
+} -start
+
+barrier b1 cond 3
+
+client c1 -connect ${h1_fe_1_sock} {
+ timeout 17
+ barrier b1 sync
+ txreq -url "/"
+ rxresp
+ expect resp.status == 200
+} -start
+client c2 -connect ${h1_fe_1_sock} {
+ timeout 17
+ barrier b1 sync
+ txreq -url "/"
+ rxresp
+ expect resp.status == 200
+} -start
+client c3 -connect ${h1_fe_1_sock} {
+ timeout 17
+ barrier b1 sync
+ txreq -url "/"
+ rxresp
+ expect resp.status == 200
+} -start
+
+client c1 -wait
+client c2 -wait
+client c3 -wait
+
+haproxy h1 -cli {
+ send "show info"
+ expect ~ "CumConns: 3001"
+ send "show info"
+ expect ~ "CumReq: 3002"
+}
--
2.18.0.windows.1