I am trying to simulate a delay between my applications and my postgres db by relaying all tcp messaging via my haproxy. this is my config
global
log /dev/log local0
defaults
log global
option tcplog
mode tcp
timeout client 10s
timeout connect 10s
timeout server 10s
timeout check 5s
frontend postgresDB
bind *:5432
tcp-request inspect-delay 5000ms
tcp-request content accept if WAIT_END
mode tcp
log global
option tcplog
default_backend postgresDB
backend postgresDB
mode tcp
server pdb 172.18.29.133:5432 check inter 5s rise 2 fall 3
It works very well with the initial connection but once the connection is established then there is no delay on any db transactions. Unfortunately my apps make their connection to the database when they start up and then maintain that connection. Is there a way HAproxy can be configured to delay all communication within the session as well as the initial connection?