I have a stick-table in my Haproxy:
backend myback
stick-table type ip size 5k expire 1h store http_req_cnt
http-request track-sc0 src
When I clear the table using:
echo "clear table myback" | sudo socat stdio /var/run/haproxy/admin.sock
And show table immediately after the above command, using:
echo "show table myback" | sudo socat stdio /var/run/haproxy/admin.sock
I still have some records in my table with a huge number of http_req_cnt which aren't possible to be in a few seconds. For example in the below image I have a record with 149 http_req_cnt which cannot be possible in a few seconds.
Plus, that the number of http records for each IP in stick-table is not equal with the number of http requests in the log file of Haproxy. Does anyone have any idea why they are different?
Note that I want a solution that helps me with resetting the stick-table http_req_cnt counter after 1h. In other words, I want each record of my table to be the number of http requests in each hour and reset the counter in the first minute of each hour (done in config file not by socat commands). I was wondering if anyone would have any suggestions. ThanksĀ inĀ advance