keepalives_* parameters usefullness - Mailing list pgsql-hackers

From Jaime Casanova
Subject keepalives_* parameters usefullness
Date
Msg-id 87wrfya130.fsf@casanova1.SEINGALT
Whole thread Raw
Responses Re: keepalives_* parameters usefullness
List pgsql-hackers
Hi,

AFAIU TFM if i set keepalives_* parameters in a conninfo they set the
internal counters to these values so if i execute:

"""
conn = PQconnectdb("host=192.168.204.10 keepalives=1 keepalives_idle=45 keepalives_interval=5 keepalives_count=5");
"""

that means that the client's connection to the server in 192.168.204.10
will wait 45 seconds after the last packet sent to the server and then
will sent a probe every 5 seconds, 5 times...

if all of the above is right then if in the client i execute a PQexec() when
the connection has already drop it should detect the failure after 1
minute 10 seconds. is that right or am i misunderstanding this?

the reason i ask is that when i use that exact conninfo it detects the
failure condition after 15 minutes always... well, actually it waits the
same time even if i doesn't set anything...

i even used getsockopt() to ensure TCP_KEEPIDLE was being setted and
tried to set it myself with setsockopt() with the same results.

BTW, this paper (http://es.scribd.com/doc/2586622/tcpkeepalivehowto) on
section "4.2. The setsockopt function call" page 9 says that to set
TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT we should use level SOL_TCP
but on src/interfaces/libpq/fe-connect.c we use IPPROTO_TCP instead.

any leads?

--
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL
Soporte 24x7, desarrollo, capacitación y servicios


pgsql-hackers by date:

Previous
From: Michael Gould
Date:
Subject: Re: Full GUID support
Next
From: Simon Riggs
Date:
Subject: Re: keepalives_* parameters usefullness