Haproxy Sticky-Table not updating

3.6k views Asked by At

i am trying to do http rate limiting using haproxy using sticky-table. But when i try to view sticky-table i am not able to see it

My configuraiton here as follows

global
    log             127.0.0.1 local1 notice
    daemon
    stats socket /run/haproxy/admin.sock mode 600 level admin
    stats timeout 2m
    user haproxy
    group haproxy
    chroot /var/lib/haproxy
    ca-base /etc/ssl/certs
    crt-base /etc/ssl/private
    tune.ssl.default-dh-param 2048
    ssl-default-bind-options no-sslv3

frontend https-jira
    bind 198.159.146.11:80
    bind 198.159.146.11:443 ssl crt /etc/haproxy/certs/stg-test.abc.com.pem
    log  127.0.0.1 local1 notice
    option httpclose
    option http-server-close
    stick-table type ip size 500k expire 30s store  
    conn_cur,conn_rate(10s),http_req_rate(10s),http_err_rate(10s)
    reqadd X-Forwarded-Proto:\ https
    reqadd X-Forwarded-Proto:\ http
    acl stg-jira hdr(host) -i stg-test.abc.com
    redirect scheme https if !{ ssl_fc } stg-test
    use_backend stg-test-backend if stg-test

  backend stg-test-backend
     server test-server 192.168.1.25:8080 check inter 2000 maxconn 500  rise 2  fall 3

When i try to view the sticky-table using any of the below command i am not able to view the table entries

  echo "show table https-test" | nc -U /run/haproxy/admin.sock

  OR

  watch -n 1 'echo "show table https-test" | socat unix:/run/haproxy/admin.sock -'

  OR

  echo "show table https-test" | socat unix-connect:/run/haproxy/admin.sock stdio

Could any one help me with the configuration to create sticky table and view the sticky-tables

1

There are 1 answers

0
Alex- On

If you do:

sudo watch -n 1 'echo "show table" | socat unix:/var/run/haproxy.sock -'

that will give you the name of your tables;

In you case it will be

sudo watch -n 1 'echo "show table stg-test-backend" | socat unix:/var/run/haproxy.sock -'