Skip to content

Instantly share code, notes, and snippets.

@haproxytechblog
Last active October 6, 2022 15:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haproxytechblog/aec210a88c10d0e864dd373f5df17f89 to your computer and use it in GitHub Desktop.
Save haproxytechblog/aec210a88c10d0e864dd373f5df17f89 to your computer and use it in GitHub Desktop.
Preserve stick table data when reloading HAProxy
peers mypeers
peer garfield 127.0.0.1:10000
global
localpeer odie
peers mypeers
peer odie 127.0.0.1:10000
frontend mysite
# the stick table declaration
stick-table type ip size 1m expire 1h store http_req_rate(10s) peers mypeers
# Data is kept
$ sudo systemctl reload haproxy
# Does not work
$ sudo systemctl restart haproxy
$ echo "show table mysite" | sudo socat stdio /var/run/haproxy/api.sock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment