Actually we have this configuration on memcached port where the keepalive
is visibile from netstat output
tcp 0 0 127.0.0.1:11233 0.0.0.0:* LISTEN
9250/memcached keepalive (0.05/0/0)
We started the haproxy with this configuration:
global
log 127.0.0.1:514 local5
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 65536
user haproxy
group haproxy
defaults
log global
retries 3
mode tcp
option tcpka
option clitcpka
option srvtcpcka
option dontlognull
option redispatch
option log-separate-errors
timeout connect 5000
timeout client 6h
timeout server 6h
frontend frontend-memcached
bind 0.0.0.0:11211
mode tcp
option tcplog
option socket-stats
default_backend backend-test
backend backend-memcached
mode tcp
balance roundrobin
server test 127.0.0.1:11233 maxconn 10000 check inter 5000
fastinter 2000 downinter 2000 rise 3 fall 3
If we check the netstat output, the keepalive is not present.
tcp 0 0 0.0.0.0:11211 0.0.0.0:*
LISTEN - off (0.00/0/0)
Marcello
On Fri, May 11, 2018 at 12:20 PM, Jarno Huuskonen <[email protected]>
wrote:
> Hi,
>
> On Fri, May 11, Marcello Lorenzi wrote:
> > we are checking the possibility to balance some memcached instances with
> an
> > HAProxy 1.8 instance but we need to implement the keepalive on TCP Listen
> > port. If we use the command "netstat -ano" we noticed that memcached
> > configure the keepalive on the connection but not HAProxy. Could you help
> > us to verify if it's possible to configure the same behavior?
>
> Does option clitcpka / option srvtcpka do what you need ?
> (https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#4-option%
> 20clitcpka
> https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#option%
> 20srvtcpka
> )
>
> Can you describe your use case ? Maybe memcached proxy (twemproxy,
> mcrouter etc.) is an alternative solution ?
>
> -Jarno
>
> --
> Jarno Huuskonen
>