Thread: support for keep alive option
The “keep alive” option is set inside the client, not the driver,
What ever programing language you are using may have a keep alive ( and timeout settings) for the OBDC driver.
Barry Bell
Senior Developer/Analyst, Harte Hanks Logsitics
Harte Hanks, Inc.
Office: 954-429-3771 Ext 267 Barry.Bell@hartehanks.com
1525 NW 3rd ST, Deerfield Beach, FL 33442
From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of PG User
Sent: Tuesday, December 17, 2013 4:27 PM
To: pgsql-odbc@postgresql.org
Subject: [ODBC] support for keep alive option
Hi,
I looking at code and found that there is an option for tpch keep alive in jdbc driver but there is no such support in odbc driver.
Is there any plan to support that in near future?
Thanking you.
- pguser
Attachment
Hi Barry,Thank you for reply.I am little bit confused.I saw the code for JDBC code and it sets true tonewStream.getSocket().setKeepAlive(requireTCPKeepAlive);if ?tchKeepAlive=true is given.But, in socket.c of odbc driver, incharSOCK_connect_to(SocketClass *self, unsigned short port, char *hostname, long timeout)Can we just do the same thing?:setsockopt(self->socket, IPPROTO_TCP, TCP_KEEPALIVE, (char *) &i, len);as did in the same function:if (setsockopt(self->socket, IPPROTO_TCP, TCP_NODELAY, (char *) &i, len) < 0) { SOCK_set_error(self, SOCKET_COULD_NOT_CONNECT, "Could not set socket to NODELAY."); closesocket(self->socket); self->socket = (SOCKETFD) -1; return 0; }- NachiketOn Tue, Dec 17, 2013 at 1:29 PM, Barry Bell <Barry.Bell@hartehanks.com> wrote:The “keep alive” option is set inside the client, not the driver,
What ever programing language you are using may have a keep alive ( and timeout settings) for the OBDC driver.
Barry Bell
Senior Developer/Analyst, Harte Hanks Logsitics
Harte Hanks, Inc.
Office: 954-429-3771 Ext 267 Barry.Bell@hartehanks.com
1525 NW 3rd ST, Deerfield Beach, FL 33442
From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of PG User
Sent: Tuesday, December 17, 2013 4:27 PM
To: pgsql-odbc@postgresql.org
Subject: [ODBC] support for keep alive option
Hi,
I looking at code and found that there is an option for tpch keep alive in jdbc driver but there is no such support in odbc driver.
Is there any plan to support that in near future?
Thanking you.
- pguser
Attachment
Hi Barry, Sorry for the late reply. (2014/01/02 23:02), Barry Bell wrote: > Thanks, Alright with me to add the patch in > > But you may want to Hiroshi (He does the office and unofficial ODBC > driver releases), > > Hiroshi, what do you think of this? OK I would introduce the functionality. Thanks. Hiroshi Inoue -- I am using the free version of SPAMfighter. SPAMfighter has removed 2543 of my spam emails to date. Get the free SPAMfighter here: http://www.spamfighter.com/len Do you have a slow PC? Try a Free scan http://www.spamfighter.com/SLOW-PCfighter?cid=sigen
On 01/08/2014 01:48 AM, Inoue, Hiroshi wrote: > Hi Barry, > > Sorry for the late reply. > > (2014/01/02 23:02), Barry Bell wrote: >> Thanks, Alright with me to add the patch in >> >> But you may want to Hiroshi (He does the office and unofficial ODBC >> driver releases), >> >> Hiroshi, what do you think of this? > > OK I would introduce the functionality. I don't think it should be enabled by default. It's common to expose keepalive and other TCP settings as an option, like libpq does, but it's not usually enabled by default, and it might be an unwelcome surprise to some existing applications. In particular, if you have a dialup connection, you do *not* want an idle connection to keep sending periodic keep-alives, because keeping the connection open costs money. It's not as big a problem these days as it used to be, but still. - Heikki
(2014/01/08 18:20), Heikki Linnakangas wrote: > On 01/08/2014 01:48 AM, Inoue, Hiroshi wrote: >> Hi Barry, >> >> Sorry for the late reply. >> >> (2014/01/02 23:02), Barry Bell wrote: >>> Thanks, Alright with me to add the patch in >>> >>> But you may want to Hiroshi (He does the office and unofficial ODBC >>> driver releases), >>> >>> Hiroshi, what do you think of this? >> >> OK I would introduce the functionality. > > I don't think it should be enabled by default. It's common to expose > keepalive and other TCP settings as an option, like libpq does, but it's > not usually enabled by default, and it might be an unwelcome surprise to > some existing applications. > > In particular, if you have a dialup connection, you do *not* want an > idle connection to keep sending periodic keep-alives, because keeping > the connection open costs money. It's not as big a problem these days as > it used to be, but still. Libpq's keepalives option is on by default. So currently psqlodbc's keepalive is enabled when libpq is used(in case ssl used etc) otherwise it is disabled. Though I am about to enable keepalive by default, I'm not sure which should be the default. regards, Hiroshi Inoue
On 01/08/2014 01:40 PM, Hiroshi Inoue wrote: > (2014/01/08 18:20), Heikki Linnakangas wrote: >> I don't think it should be enabled by default. It's common to expose >> keepalive and other TCP settings as an option, like libpq does, but it's >> not usually enabled by default, and it might be an unwelcome surprise to >> some existing applications. >> >> In particular, if you have a dialup connection, you do *not* want an >> idle connection to keep sending periodic keep-alives, because keeping >> the connection open costs money. It's not as big a problem these days as >> it used to be, but still. > > Libpq's keepalives option is on by default. Oh, I didn't realize that. > So currently psqlodbc's > keepalive is enabled when libpq is used(in case ssl used etc) otherwise > it is disabled. > Though I am about to enable keepalive by default, I'm not sure which > should be the default. I guess it would be best to enable it by default in psqlodbc as well, then. - Heikki
On 01/08/2014 01:40 PM, Hiroshi Inoue wrote:(2014/01/08 18:20), Heikki Linnakangas wrote:I don't think it should be enabled by default. It's common to expose
keepalive and other TCP settings as an option, like libpq does, but it's
not usually enabled by default, and it might be an unwelcome surprise to
some existing applications.
In particular, if you have a dialup connection, you do *not* want an
idle connection to keep sending periodic keep-alives, because keeping
the connection open costs money. It's not as big a problem these days as
it used to be, but still.
Libpq's keepalives option is on by default.
Oh, I didn't realize that.I guess it would be best to enable it by default in psqlodbc as well, then.So currently psqlodbc's
keepalive is enabled when libpq is used(in case ssl used etc) otherwise
it is disabled.
Though I am about to enable keepalive by default, I'm not sure which
should be the default.
- Heikki
Hi All,Thank you very much for your thoughts and discussions.I need a last favor:Is it possible for you to add functionality to postgres odbc version 9.x (latest) as well as 8.4.2?Thanking you.- NachiketOn Wed, Jan 8, 2014 at 4:06 AM, Heikki Linnakangas <hlinnakangas@vmware.com> wrote:On 01/08/2014 01:40 PM, Hiroshi Inoue wrote:(2014/01/08 18:20), Heikki Linnakangas wrote:I don't think it should be enabled by default. It's common to expose
keepalive and other TCP settings as an option, like libpq does, but it's
not usually enabled by default, and it might be an unwelcome surprise to
some existing applications.
In particular, if you have a dialup connection, you do *not* want an
idle connection to keep sending periodic keep-alives, because keeping
the connection open costs money. It's not as big a problem these days as
it used to be, but still.
Libpq's keepalives option is on by default.
Oh, I didn't realize that.I guess it would be best to enable it by default in psqlodbc as well, then.So currently psqlodbc's
keepalive is enabled when libpq is used(in case ssl used etc) otherwise
it is disabled.
Though I am about to enable keepalive by default, I'm not sure which
should be the default.
- Heikki
(2014/01/14 6:02), PG User wrote: > Do we know when the patch will be available in postgres odbc code for > mentioned versions? I pushd the change to set TCP keepalive by default. regards, Hiroshi Inoue -- I am using the free version of SPAMfighter. SPAMfighter has removed 2897 of my spam emails to date. Get the free SPAMfighter here: http://www.spamfighter.com/len Do you have a slow PC? Try a Free scan http://www.spamfighter.com/SLOW-PCfighter?cid=sigen
(2014/01/14 6:02), PG User wrote:I pushd the change to set TCP keepalive by default.Do we know when the patch will be available in postgres odbc code for
mentioned versions?
regards,SPAMfighter has removed 2897 of my spam emails to date.
Hiroshi Inoue
--
I am using the free version of SPAMfighter.
Get the free SPAMfighter here: http://www.spamfighter.com/len
Do you have a slow PC? Try a Free scan http://www.spamfighter.com/SLOW-PCfighter?cid=sigen
(2014/01/21 9:31), PG User wrote: > Hi Hiroshi, > Thank you for mail. > > I see new code in git repo. > This change will go to 8.4.2 as well, right? No. Please upgrade to the next version. regards, Hiroshi Inoue